added apis.ToApiError alias

This commit is contained in:
Gani Georgiev 2024-11-22 20:44:29 +02:00
parent 7795a086ef
commit 305e183f58
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,11 @@ import "github.com/pocketbase/pocketbase/tools/router"
// 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].
func NewApiError(status int, message string, errData any) *router.ApiError {
return router.NewApiError(status, message, errData)