Skip to content

Commit

Permalink
Add new error type—"resulting image is too large"
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Nov 10, 2024
1 parent 7bb18ed commit 9143303
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.14",
"version": "1.0.15",
"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 @@ -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 {
Expand All @@ -39,6 +40,15 @@ const allErrors: Record<ErrorCode, APIError> = {
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",
Expand Down

0 comments on commit 9143303

Please sign in to comment.