Skip to content

Commit

Permalink
error out if neither TrackResponse or Error are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
javamatte committed Jun 1, 2023
1 parent c400f2b commit 3bcf7f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion carriers/usps.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function USPS(options) {

if (err) {
return callback(err);
} else if (!data) {
} else if (!data || (!data.Error && !data.TrackResponse)) {
return callback(new Error('Invalid or missing TrackResponse'));
} else if (data.Error) {
// Invalid credentials or Invalid Tracking Number
Expand Down

0 comments on commit 3bcf7f8

Please sign in to comment.