Skip to content

Commit

Permalink
Improving error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrunkat committed May 13, 2019
1 parent 98da2f0 commit ccfa24e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@ export const requestPromise = async (options, stats) => {
// - status code is >= 500
// - RATE_LIMIT_EXCEEDED_STATUS_CODE
// then we throw the retryable error that is repeated by the retryWithExpBackoff function up to `expBackOffMaxRepeats` repeats.
const originalError = new ApifyClientError(
REQUEST_FAILED_ERROR_TYPE,
`API request failed after ${iteration} retries.`,
errorDetails,
);
const errorMsg = iteration === 0
? 'API request failed on the first retry'
: `API request failed on retry number ${iteration}`;
const originalError = new ApifyClientError(REQUEST_FAILED_ERROR_TYPE, errorMsg, errorDetails);
throw new RetryableError(originalError);
};

Expand Down

0 comments on commit ccfa24e

Please sign in to comment.