Skip to content

Commit

Permalink
feat: make error.headers optional
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 4, 2019
1 parent 4b34e4d commit a8d5625
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class RequestError extends Error {
return statusCode;
}
});
this.headers = options.headers;
this.headers = options.headers || {};

// redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RequestOptions, ResponseHeaders } from "@octokit/types";

export type RequestErrorOptions = {
headers: ResponseHeaders;
headers?: ResponseHeaders;
request: RequestOptions;
};

0 comments on commit a8d5625

Please sign in to comment.