You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-25 23:52:32 +02:00
added apis.ToApiError alias
This commit is contained in:
@@ -6,6 +6,11 @@ import "github.com/pocketbase/pocketbase/tools/router"
|
|||||||
// and for consistency with the JSVM binds.
|
// and for consistency with the JSVM binds.
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
||||||
|
// ToApiError wraps err into ApiError instance (if not already).
|
||||||
|
func ToApiError(err error) *router.ApiError {
|
||||||
|
return router.ToApiError(err)
|
||||||
|
}
|
||||||
|
|
||||||
// NewApiError is an alias for [router.NewApiError].
|
// NewApiError is an alias for [router.NewApiError].
|
||||||
func NewApiError(status int, message string, errData any) *router.ApiError {
|
func NewApiError(status int, message string, errData any) *router.ApiError {
|
||||||
return router.NewApiError(status, message, errData)
|
return router.NewApiError(status, message, errData)
|
||||||
|
|||||||
Reference in New Issue
Block a user