mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
20 lines
349 B
Go
20 lines
349 B
Go
package graphql
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"os"
|
|
"runtime/debug"
|
|
)
|
|
|
|
type RecoverFunc func(ctx context.Context, err interface{}) (userMessage error)
|
|
|
|
func DefaultRecover(ctx context.Context, err interface{}) error {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
fmt.Fprintln(os.Stderr)
|
|
debug.PrintStack()
|
|
|
|
return errors.New("internal system error")
|
|
}
|