forked from lug/matterbridge
Update dependencies (#1784)
This commit is contained in:
18
vendor/github.com/graph-gophers/graphql-go/errors/panic_handler.go
generated
vendored
Normal file
18
vendor/github.com/graph-gophers/graphql-go/errors/panic_handler.go
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package errors
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// PanicHandler is the interface used to create custom panic errors that occur during query execution
|
||||
type PanicHandler interface {
|
||||
MakePanicError(ctx context.Context, value interface{}) *QueryError
|
||||
}
|
||||
|
||||
// DefaultPanicHandler is the default PanicHandler
|
||||
type DefaultPanicHandler struct{}
|
||||
|
||||
// MakePanicError creates a new QueryError from a panic that occurred during execution
|
||||
func (h *DefaultPanicHandler) MakePanicError(ctx context.Context, value interface{}) *QueryError {
|
||||
return Errorf("panic occurred: %v", value)
|
||||
}
|
||||
Reference in New Issue
Block a user