Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for internal/errors/runtime #984

Merged
merged 8 commits into from
Feb 8, 2021
Merged
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