wip (apply)

This commit is contained in:
2025-10-20 01:35:32 +02:00
parent 8ca8918966
commit a95dd4f3e0
14 changed files with 354 additions and 15 deletions

View File

@@ -2,13 +2,14 @@ package api
import (
"encoding/json"
"fmt"
"log/slog"
"mirror-sync/pkg/remote/obj"
"net/http"
"time"
)
func internalServerError(w http.ResponseWriter, r *http.Request) {
func internalServerError(err any, w http.ResponseWriter, r *http.Request) {
payload := obj.HTTPError{
HTTPCore: obj.HTTPCore{
Status: http.StatusInternalServerError,
@@ -16,7 +17,7 @@ func internalServerError(w http.ResponseWriter, r *http.Request) {
Timestamp: time.Now(),
},
Error: "Internal Server Error",
Message: "The server encountered an unexpected condition that prevented it from fulfilling the request.",
Message: fmt.Sprintf("%v", err),
}
w.Header().Add("Content-Type", "application/json")