File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ package responses
2
+
3
+ import (
4
+ "errors"
5
+ "net/http"
6
+ )
7
+
8
+ // GenericBadRequestError implements a generic not found error. It receives the code and message as params.
9
+ func GenericBadRequestError (code string , message string ) error {
10
+ return NewGenericHttpError (http .StatusBadRequest , code , errors .New (message ))
11
+ }
12
+
13
+ // GenericAlreadyExistsError implements a generic not found error. It receives the code and message as params.
14
+ func GenericAlreadyExistsError (code string , message string ) error {
15
+ return NewGenericHttpError (http .StatusBadRequest , code , errors .New (message ))
16
+ }
17
+
18
+ // GenericNotFoundError implements a generic not found error. It receives the code and message as params.
19
+ func GenericNotFoundError (code string , message string ) error {
20
+ return NewGenericHttpError (http .StatusNotFound , code , errors .New (message ))
21
+ }
22
+
23
+ // GenericInternalServerError implements a generic not found error. It receives the code and message as params.
24
+ func GenericInternalServerError (code string , message string ) error {
25
+ return NewGenericHttpError (http .StatusInternalServerError , code , errors .New (message ))
26
+ }
You can’t perform that action at this time.
0 commit comments