account page: can now reorder entries under shops sections by drag and drop
This commit is contained in:
@@ -150,7 +150,13 @@ func (e ErrorResponse) GetHTML() ([]byte, bool) {
|
||||
}
|
||||
|
||||
func GetError(err error) (e ErrorResponse, ok bool) {
|
||||
ok = errors.As(err, &e)
|
||||
if ok = errors.As(err, &e); ok {
|
||||
return e, true
|
||||
}
|
||||
var ptr *ErrorResponse
|
||||
if ok = errors.As(err, &ptr); ok {
|
||||
return *ptr, true
|
||||
}
|
||||
return e, ok
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -45,6 +46,11 @@ func HandleErrors(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
var err error
|
||||
for _, e := range c.Errors {
|
||||
err = errors.Join(err, e)
|
||||
}
|
||||
c.String(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user