-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from atkrad/remove-log-level-flag
Depricate the --log-level flag and returns the errors by default
- Loading branch information
Showing
26 changed files
with
252 additions
and
277 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
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
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
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
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
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
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,38 @@ | ||
package checker | ||
|
||
import "fmt" | ||
|
||
// ExpectedError defines the expectation error | ||
type ExpectedError struct { | ||
msg string | ||
cause error | ||
details []any | ||
} | ||
|
||
// NewExpectedError creates the ExpectedError | ||
func NewExpectedError(msg string, cause error, details ...any) error { | ||
ee := &ExpectedError{ | ||
msg: msg, | ||
cause: cause, | ||
details: details, | ||
} | ||
|
||
return ee | ||
} | ||
|
||
// Details returns the error details | ||
func (ee *ExpectedError) Details() []any { | ||
return ee.details | ||
} | ||
|
||
func (ee *ExpectedError) Unwrap() error { | ||
return ee.cause | ||
} | ||
|
||
func (ee *ExpectedError) Error() string { | ||
if ee.cause != nil { | ||
return fmt.Sprintf("%s, caused by: %s", ee.msg, ee.cause.Error()) | ||
} | ||
|
||
return ee.msg | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.