Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Oct 2, 2023
1 parent d8a6a97 commit b1ef837
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions errors/HubSpotAuthError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ export class HubSpotAuthError extends Error {
super(message);
this.name = 'HubSpotAuthError';
this.statusCode = cause.statusCode;
this.category =
(cause.response && cause.response.body && cause.response.body.category) ||
undefined;
this.category = cause?.response?.body?.category || undefined;
this.subCategory =
(cause.response &&
cause.response.body &&
Expand Down
2 changes: 1 addition & 1 deletion lib/personalAccessKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function getAccessToken(
if (error.response) {
throwAuthErrorWithMessage(
'personalAccessKey.invalidPersonalAccessKey',
{ errorMessage: error.response.body.message },
{ errorMessage: error.response.body.message || '' },
error
);
} else {
Expand Down
2 changes: 2 additions & 0 deletions types/Error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface StatusCodeError extends BaseError {
body: {
message?: string;
errors?: Array<StatusCodeError>;
category?: string;
subCategory?: string;
};
headers: {
[key: string]: string;
Expand Down

0 comments on commit b1ef837

Please sign in to comment.