Skip to content

Commit

Permalink
fix(pgdriver): return FATAL and PANIC errors immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
htdvisser committed Jul 31, 2022
1 parent 229c892 commit 4595e38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion driver/pgdriver/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,14 @@ func readError(rd *reader) (error, error) {
}
m[c] = s
}
return Error{m: m}, nil
switch err := (Error{m: m}); err.Field('V') {
case "FATAL", "PANIC":
// Return this as an error and stop processing.
return nil, err
default:
// Return this as an error message and continue processing.
return err, nil
}
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 4595e38

Please sign in to comment.