Skip to content

Commit

Permalink
add test for internal/errors/runtime (#984)
Browse files Browse the repository at this point in the history
* ✅ add test for internal/errors/runtime

Signed-off-by: vankichi <kyukawa315@gmail.com>

* 🤖 Update license headers / Format go codes and yaml files

Signed-off-by: vdaas-ci <ci@vdaas.org>

* Update internal/errors/runtime.go

Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>

* Update internal/errors/runtime.go

Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>

* Update internal/errors/runtime.go

Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>

* Update internal/errors/runtime_test.go

* ✅ update runtime_test with feedback

Signed-off-by: vankichi <kyukawa315@gmail.com>

* Update internal/errors/runtime_test.go

Co-authored-by: Kevin Diu <kevindiujp@gmail.com>

Co-authored-by: vdaas-ci <ci@vdaas.org>
Co-authored-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Kevin Diu <kevindiujp@gmail.com>
  • Loading branch information
4 people authored Feb 8, 2021
1 parent 81c93d3 commit 2eb8668
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 2eb8668

Please sign in to comment.