Skip to content

Commit bf33c66

Browse files
committed
feat: add NewNotFoundError function
1 parent a82256d commit bf33c66

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

utils/costum_error.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ func NewUnauthorizedError(ctx context.Context, msg string, err error) *CustomHtt
4747
}
4848
}
4949

50+
func NewNotFoundError(ctx context.Context, msg string, err error) *CustomHttpError {
51+
ngelog.Error(ctx, msg, err)
52+
return &CustomHttpError{
53+
Code: http.StatusNotFound,
54+
Message: msg,
55+
OriginError: err,
56+
}
57+
}
58+
5059
func NewInternalServerError(ctx context.Context, err error) *CustomHttpError {
5160
ngelog.Error(ctx, "Internal server error", err)
5261
return &CustomHttpError{

0 commit comments

Comments
 (0)