-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.go
38 lines (35 loc) · 875 Bytes
/
error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"github.com/valyala/fasthttp"
"github.com/vikebot/vbnet"
)
const (
codeInternalServerError = 9000
codeNotFound = 9001
codeNotImplemented = 9002
codeInsufficientPermission = 9003
codeEndpointAssertionFailed = 9004
codeNoAuthProvided = 9005
)
var (
errInternalServerError = vbnet.NewHTTPError(
"Internal Server Error",
fasthttp.StatusInternalServerError,
codeInternalServerError,
nil)
errUnknownEndpoit = vbnet.NewHTTPError(
"No API endpoint matches your request",
fasthttp.StatusNotFound,
codeNotFound,
nil)
errNotImplemented = vbnet.NewHTTPError(
"Not implemented",
fasthttp.StatusNotImplemented,
codeNotImplemented,
nil)
errEndpointAssertionFailed = vbnet.NewHTTPError(
"Internal Server Error",
fasthttp.StatusInternalServerError,
codeEndpointAssertionFailed,
nil)
)