Skip to content
Closed
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
16 changes: 8 additions & 8 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1951,14 +1951,6 @@ export class OpenSeaAPI {
return undefined
}

/**
* Creates a rate limit error with status code and retry-after information.
* This is async because it attempts to parse the response body. If the body
* is malformed JSON, responseBody will be undefined (intentional — the error
* itself is more important than the body).
* @param response The HTTP response object from the API
* @returns An enhanced Error object with statusCode, retryAfter and responseBody properties
*/
/**
* Builds an error carrying the HTTP status. Every non-OK response goes through here or through
* {@link _createRateLimitError}, so `statusCode` is present on every API error rather than only
Expand All @@ -1981,6 +1973,14 @@ export class OpenSeaAPI {
return error
}

/**
* Creates a rate limit error with status code and retry-after information.
* This is async because it attempts to parse the response body. If the body
* is malformed JSON, responseBody will be undefined (intentional — the error
* itself is more important than the body).
* @param response The HTTP response object from the API
* @returns An enhanced Error object with statusCode, retryAfter and responseBody properties
*/
private async _createRateLimitError(
response: Response,
): Promise<OpenSeaRateLimitError> {
Expand Down