Skip to content

Commit

Permalink
Add new error type: content_missing_specified_string
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Feb 2, 2025
1 parent 7e94872 commit d36e5a9
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.17",
"version": "1.0.18",
"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 @@ -18,6 +18,7 @@ export enum ErrorCode {
HostReturnedError = "host_returned_error",
StorageReturnedTransientError = "storage_returned_transient_error",
ContentContainsSpecifiedString = "content_contains_specified_string",
ContentMissingSpecifiedString = "content_missing_specified_string",
TemporaryUnavailable = "temporary_unavailable",
ResultingImageTooLarge = "resulting_image_too_large",
InvalidCookieParameter = "invalid_cookie_parameter",
Expand Down Expand Up @@ -104,6 +105,15 @@ const allErrors: Record<ErrorCode, APIError> = {
documentationUrl:
"https://screenshotone.com/docs/errors/host-returned-error/",
},
[ErrorCode.ContentMissingSpecifiedString]: {
httpStatusCode: 500,
title: "Content Missing Specified String",
code: "content_missing_specified_string",
description:
"The page content is missing the specified string by the `fail_if_content_missing` option. If it seems to be a mistake or not what you expected, please, reach out to `[email protected]` as quickly as possible, and will assist and try to resolve your problem.",
documentationUrl:
"https://screenshotone.com/docs/errors/content-missing-specified-string/",
},
[ErrorCode.ContentContainsSpecifiedString]: {
httpStatusCode: 500,
title: "Content Contains Specified String",
Expand Down

0 comments on commit d36e5a9

Please sign in to comment.