-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: moved sentinel errors into appropriate file
Signed-off-by: Bernd Warmuth <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
23 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 |
---|---|---|
@@ -1,23 +1 @@ | ||
package openfeature | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
// ProviderInitError represents an error that occurs during provider initialization. | ||
type ProviderInitError struct { | ||
ErrorCode ErrorCode // Field to store the specific error code | ||
Message string // Custom error message | ||
} | ||
|
||
// Error implements the error interface for ProviderInitError. | ||
func (e *ProviderInitError) Error() string { | ||
return fmt.Sprintf("ProviderInitError: %s (code: %s)", e.Message, e.ErrorCode) | ||
} | ||
|
||
// ProviderNotReadyError signifies that an operation failed because the provider is in a NOT_READY state. | ||
var ProviderNotReadyError = errors.New("provider not yet initialized") | ||
|
||
// ProviderFatalError signifies that an operation failed because the provider is in a FATAL state. | ||
var ProviderFatalError = errors.New("provider is in an irrecoverable error state") |
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