Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/exceptions/FortniteAPIError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* The HTTP method
*/
public method: string;

Check failure on line 12 in src/exceptions/FortniteAPIError.ts

View workflow job for this annotation

GitHub Actions / Test Code (Node 18)

Trailing spaces not allowed.
/**
* The URL of the requested API endpoint
*/
Expand All @@ -35,7 +35,7 @@
this.name = 'FortniteAPIError';
this.message = error.error;

this.method = request.method!.toUpperCase();
this.method = request.method?.toUpperCase() ?? 'GET'

Check failure on line 38 in src/exceptions/FortniteAPIError.ts

View workflow job for this annotation

GitHub Actions / Test Code (Node 18)

Missing semicolon.
this.url = request.url!;
this.httpStatus = status;
this.requestParams = request.params;
Expand Down
4 changes: 2 additions & 2 deletions src/http/HTTP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HTTP {
};

try {
const response = await this.axios(config);
const response = await instance(config);

return response.data;
} catch (e) {
Expand All @@ -56,7 +56,7 @@ class HTTP {
}
}

throw new FortniteAPIError(e.response.data, config, e.response.status);
throw new FortniteAPIError(e.response.data, e.config ?? config, e.response.status);
}

throw e;
Expand Down