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 Jan 16, 2024
1 parent 7801b91 commit da501a0
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 da501a0

Please sign in to comment.