diff --git a/packages/web-api/src/WebClient.spec.js b/packages/web-api/src/WebClient.spec.js index 8bbb1b297..8d452e7e0 100644 --- a/packages/web-api/src/WebClient.spec.js +++ b/packages/web-api/src/WebClient.spec.js @@ -1143,6 +1143,7 @@ describe('WebClient', function () { client.apiCall('method') .catch((err) => { assert.instanceOf(err, Error); + assert.include(err.message, 'retry-after header: notanumber', 'Raw retry-after header value included in error'); scope.done(); done(); }); diff --git a/packages/web-api/src/WebClient.ts b/packages/web-api/src/WebClient.ts index 2ec81c499..521725918 100644 --- a/packages/web-api/src/WebClient.ts +++ b/packages/web-api/src/WebClient.ts @@ -414,7 +414,7 @@ export class WebClient extends Methods { throw Error(`A rate limit was exceeded (url: ${url}, retry-after: ${retrySec})`); } else { // TODO: turn this into some CodedError - throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url})`)); + throw new AbortError(new Error(`Retry header did not contain a valid timeout (url: ${url}, retry-after header: ${response.headers['retry-after']})`)); } }