-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [+] feat(error.go): add global error variables for common error cases - [+] refactor(middleware.go): replace inline errors with global error variables - [+] refactor(storage.go): replace inline errors with global error variables - [+] refactor(storage.go): wrap errors using fmt.Errorf for ErrorFailedToDeleteInfo and ErrorFailedToResetStorage
- Loading branch information
1 parent
91cfbb2
commit 574a30a
Showing
3 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2024 H0llyW00dz All rights reserved. | ||
// | ||
// License: BSD 3-Clause License | ||
|
||
package twofa | ||
|
||
import "errors" | ||
|
||
// Global error variables | ||
var ( | ||
ErrorFailedToRetrieveInfo = errors.New("failed to retrieve 2FA information") | ||
ErrorFailedToUnmarshalInfo = errors.New("failed to unmarshal 2FA information") | ||
ErrorFailedToMarshalInfo = errors.New("failed to marshal updated 2FA information") | ||
ErrorFailedToStoreInfo = errors.New("failed to store updated 2FA information") | ||
ErrorFailedToDeleteInfo = errors.New("failed to delete 2FA information") | ||
ErrorFailedToResetStorage = errors.New("failed to reset storage") | ||
ErrorFailedToCloseStorage = errors.New("failed to close storage") | ||
ErrorContextKeyNotSet = errors.New("ContextKey is not set") | ||
ErrorFailedToRetrieveContextKey = errors.New("failed to retrieve context key") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters