Skip to content

Commit

Permalink
exectuor: add stack trace for runtime panic (pingcap#50449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 authored and ti-chi-bot committed Jan 16, 2024
1 parent 3f84f3f commit efc776a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ func IsInCorrectIdentifierName(name string) bool {
// GetRecoverError gets the error from recover.
func GetRecoverError(r interface{}) error {
if err, ok := r.(error); ok {
return err
// Runtime panic also implements error interface.
// So do not forget to add stack info for it.
return errors.Trace(err)
}
return errors.Errorf("%v", r)
}

0 comments on commit efc776a

Please sign in to comment.