From 9143303454b6e73cb3b1580c2cdf125330d4a051 Mon Sep 17 00:00:00 2001 From: Dmytro Krasun Date: Sun, 10 Nov 2024 15:11:45 +0200 Subject: [PATCH] =?UTF-8?q?Add=20new=20error=20type=E2=80=94"resulting=20i?= =?UTF-8?q?mage=20is=20too=20large"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/main.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 735c39d..be8187c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "screenshotone-errors", "homepage": "https://screenshotone.com", - "version": "1.0.14", + "version": "1.0.15", "description": "Errors produced by the ScreenshotOne API.", "repository": { "type": "git", diff --git a/src/main.ts b/src/main.ts index 74ef13d..f718c53 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,6 +19,7 @@ export enum ErrorCode { StorageReturnedTransientError = "storage_returned_transient_error", ContentContainsSpecifiedString = "content_contains_specified_string", TemporaryUnavailable = "temporary_unavailable", + ResultingImageTooLarge = "resulting_image_too_large", } interface APIError { @@ -39,6 +40,15 @@ const allErrors: Record = { documentationUrl: "https://screenshotone.com/docs/errors/selector-not-found/", }, + [ErrorCode.ResultingImageTooLarge]: { + httpStatusCode: 400, + title: "Resulting Image Too Large", + code: "resulting_image_too_large", + description: + "The resulting image is too large for the specified format.", + documentationUrl: + "https://screenshotone.com/docs/errors/resulting-image-too-large/", + }, [ErrorCode.NameNotResolved]: { httpStatusCode: 400, title: "Name Not Resolved",