Skip to content

Commit 59a4691

Browse files
committed
chore: Add permission/exception utilities
1 parent 312bad8 commit 59a4691

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pkg/exception/exception.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ var exceptionIdTag = "exception_id"
88

99
type Exception uint16
1010

11+
func (e Exception) Ptr() *Exception {
12+
return &e
13+
}
14+
1115
/*
1216
Errors explained:
1317
@@ -18,7 +22,11 @@ X - Unknown (0) | Non-Critical (1) | Critical (2);
1822
Z - Error code
1923
*/
2024
const (
21-
IdUnknown Exception = 1000
25+
IdUnknown Exception = 1001
26+
27+
IdRouteError Exception = 2101
28+
IdServerError Exception = 2201
29+
IdDBError Exception = 2202
2230

2331
IdGenericNotFound Exception = 3101
2432

pkg/utils/ptr.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package utils
22

3+
var (
4+
False *bool = ToPtr(false)
5+
True *bool = ToPtr(true)
6+
)
7+
38
func ToPtr[T any](obj T) *T {
49
return &obj
510
}

0 commit comments

Comments
 (0)