diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
| commit | ecc6a55aba7bb35fc778e7a53848396b88214151 (patch) | |
| tree | 1b37a2dc5f4594155114da1ae0c4529d20a4c548 /api/dto/util.go | |
| parent | 8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (diff) | |
Add multiple conferences feature
Diffstat (limited to 'api/dto/util.go')
| -rw-r--r-- | api/dto/util.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api/dto/util.go b/api/dto/util.go index cb3ea52..651f026 100644 --- a/api/dto/util.go +++ b/api/dto/util.go @@ -36,8 +36,8 @@ func WrapResponseFunc(dtoFunc func(http.ResponseWriter, *http.Request) error) ht } } -func WriteDto(w http.ResponseWriter, r *http.Request, o error) { - if o, ok := o.(Response); ok { +func WriteDto(w http.ResponseWriter, r *http.Request, err error) { + if o, ok := err.(Response); ok { data, err := json.Marshal(o) if err != nil { w.WriteHeader(500) @@ -49,6 +49,6 @@ func WriteDto(w http.ResponseWriter, r *http.Request, o error) { w.Write(data) } else { w.WriteHeader(500) - slog.Error("internal server error handling request", "error", o) + slog.Error("internal server error handling request", "error", err) } } |
