Skip to content

Commit

Permalink
Panic on bad error usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 30, 2023
1 parent e781e86 commit 63b82af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/exceptions/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ func New(message ...any) error {

func Cause(cause error, message ...any) error {
if cause == nil {
return nil
panic("cause on an nil error")
}
return &causeError{F.ToString(message...), cause}
}

func Extend(cause error, message ...any) error {
if cause == nil {
return nil
panic("extend on an nil error")
}
return &extendedError{F.ToString(message...), cause}
}
Expand Down

0 comments on commit 63b82af

Please sign in to comment.