feat(api): throw error on retry limit
This commit is contained in:
parent
3f96cc43a0
commit
1428b79ea0
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ export class ApiHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async makeRequest<T>(routeId: IRouteIdentifier, options: IMakeRequestOptions, retries = 0): Promise<T> {
|
public async makeRequest<T>(routeId: IRouteIdentifier, options: IMakeRequestOptions, retries = 0): Promise<T> {
|
||||||
|
if (retries === this.client.options.api.retryLimit) throw new Error('Retry limit has been exceeded!');
|
||||||
|
|
||||||
const headers: Map<string, string> = new Map();
|
const headers: Map<string, string> = new Map();
|
||||||
|
|
||||||
if (options.headers) for (const prop in options.headers) headers.set(prop, options.headers[prop]!);
|
if (options.headers) for (const prop in options.headers) headers.set(prop, options.headers[prop]!);
|
||||||
|
|
Reference in a new issue