Skip to content

Commit

Permalink
Merge 5927318 into 81c93d3
Browse files Browse the repository at this point in the history
  • Loading branch information
vankichi authored Feb 8, 2021
2 parents 81c93d3 + 5927318 commit 722a6ea
Show file tree
Hide file tree
Showing 2 changed files with 434 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/errors/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ package errors
import "runtime"

var (
// Runtime.

// ErrPanicRecovered represents a function to generate an error that the panic recovered.
ErrPanicRecovered = func(err error, rec interface{}) error {
return Wrap(err, Errorf("panic recovered: %v", rec).Error())
}

// ErrPanicString represents a function to generate an error that the panic recovered with a string message.
ErrPanicString = func(err error, msg string) error {
return Wrap(err, Errorf("panic recovered: %v", msg).Error())
}

// ErrRuntimeError represents a function to generate an error that the panic caused by runtime error.
ErrRuntimeError = func(err error, r runtime.Error) error {
return Wrap(err, Errorf("system panicked caused by runtime error: %v", r).Error())
}
Expand Down
Loading

0 comments on commit 722a6ea

Please sign in to comment.