You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-12-24 00:01:31 +02:00
checkpoint
This commit is contained in:
@@ -32,7 +32,12 @@ func RespondJsonError(ctx context.Context, w http.ResponseWriter, err error) err
|
||||
|
||||
// If the error was of the type *Error, the handler has
|
||||
// a specific status code and error to return.
|
||||
if webErr, ok := errors.Cause(err).(*Error); ok {
|
||||
webErr, ok := errors.Cause(err).(*Error)
|
||||
if !ok {
|
||||
webErr, ok = err.(*Error)
|
||||
}
|
||||
|
||||
if ok {
|
||||
er := ErrorResponse{
|
||||
Error: webErr.Err.Error(),
|
||||
Fields: webErr.Fields,
|
||||
|
||||
Reference in New Issue
Block a user