Skip to content

Commit

Permalink
Cover the "request_aborted" API error
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Jul 28, 2024
1 parent a1d97c2 commit ff1b0fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-errors",
"homepage": "https://screenshotone.com",
"version": "1.0.12",
"version": "1.0.13",
"description": "Errors produced by the ScreenshotOne API.",
"repository": {
"type": "git",
Expand Down
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum ErrorCode {
ScriptTriggersRedirect = "script_triggers_redirect",
InternalApplicationError = "internal_application_error",
UsageQuotaExceeded = "screenshots_limit_reached",
RequestAborted = "request_aborted",
}

interface APIError {
Expand Down Expand Up @@ -59,6 +60,15 @@ const allErrors: Record<ErrorCode, APIError> = {
documentationUrl:
"https://screenshotone.com/docs/errors/script-triggers-redirect/",
},
[ErrorCode.RequestAborted]: {
httpStatusCode: 500,
title: "Request Aborted",
code: "request_aborted",
description:
"The request was aborted either by the user or the intermediate proxies and can't be fulfilled. If the error persists, please, reach out to `support@screenshotone.com`.",
documentationUrl:
"https://screenshotone.com/docs/errors/request-aborted/",
},
};

export function APIErrorByCode(code: string) {
Expand Down

0 comments on commit ff1b0fb

Please sign in to comment.