Skip to content

Commit

Permalink
Fix data type of ServerError
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 20, 2024
1 parent 167dcae commit 077c8a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type HTTPError struct {

// ServerError represents HTTP server error structure
type ServerError struct {
DBSError error `json:"error"` // DBS error
HTTPError HTTPError `json:"http"` // HTTP section of the error
DBSError string `json:"dbs_error"` // DBS error
HTTPError HTTPError `json:"http_http"` // HTTP section of the error
Exception int `json:"exception"` // for compatibility with Python server
Type string `json:"type"` // for compatibility with Python server
Message string `json:"message"` // for compatibility with Python server
Expand All @@ -66,7 +66,7 @@ func responseMsg(w http.ResponseWriter, r *http.Request, err error, code int) in
}
rec := ServerError{
HTTPError: hrec,
DBSError: err,
DBSError: err.Error(),
Exception: code, // for compatibility with Python server
Type: "HTTPError", // for compatibility with Python server
Message: err.Error(), // for compatibility with Python server
Expand Down

0 comments on commit 077c8a5

Please sign in to comment.