Files
extrovert/internals/router/errors/500.go
2024-07-30 11:51:55 -03:00

17 lines
368 B
Go

package errors
import (
"errors"
"net/http"
)
type ErrInternal struct {
Err string `json:"error"`
}
func NewErrInternal(err ...error) RouteErrorHandler {
return defaultErrorHandler{ErrInternal{Err: errors.Join(err...).Error()}}
}
func (e ErrInternal) Error() string { return e.Err }
func (e ErrInternal) Status() int { return http.StatusInternalServerError }