mock mode: database queries implemented and checkbox on account page built
This commit is contained in:
@@ -167,10 +167,22 @@ func ErrorFromConstant(err error) error {
|
||||
cerr := err
|
||||
for cerr != nil {
|
||||
switch cerr {
|
||||
// if the error already is an ErrorResponse with the appropriate status, nothing needs to be done.
|
||||
// else the error needs to be wrapped in the appropriate ErrorResponse.
|
||||
case consts.ErrNotFound:
|
||||
return NotFound()
|
||||
if er, ok := GetError(err); ok {
|
||||
if s, ok := er.GetStatus(); ok && s == http.StatusNotFound {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return NotFound().Wrap(err)
|
||||
case consts.ErrConflict:
|
||||
return Conflict()
|
||||
if er, ok := GetError(err); ok {
|
||||
if s, ok := er.GetStatus(); ok && s == http.StatusConflict {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return Conflict().Wrap(err)
|
||||
}
|
||||
|
||||
uerr, ok := cerr.(interface {
|
||||
|
||||
Reference in New Issue
Block a user