From 8c08d9b6a7d5c883f7ad6ac3d94fccd7abc0187b Mon Sep 17 00:00:00 2001 From: Paul Spicer Date: Mon, 5 Mar 2018 15:35:20 -0500 Subject: [PATCH] Added headers to ClearbitError in order to pass back values returned from certain error responses, i.e. the "Retry-After" header returned from rate_limit errors --- src/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client.js b/src/client.js index e4ec114..2bbc088 100644 --- a/src/client.js +++ b/src/client.js @@ -82,6 +82,7 @@ ClearbitClient.prototype.request = function (options) { throw _.extend(new this.ClearbitError(message), { type: body.error ? body.error.type : 'unknown', body: body, + headers: response.headers, statusCode: response.statusCode }); }