Skip to content

Commit

Permalink
Expose the API error
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Aug 26, 2024
1 parent bbc6d6f commit 6cbf4c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-api-sdk",
"homepage": "https://screenshotone.com",
"version": "1.1.14",
"version": "1.1.15",
"description": "Use ScreenshotOne.com API to generate screenshots of any website.",
"repository": {
"type": "git",
Expand Down
6 changes: 2 additions & 4 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

class APIError extends Error {
export default class APIError extends Error {
public readonly httpStatusCode?: number;
public readonly errorCode?: string;
public readonly errorMessage?: string;
Expand All @@ -13,6 +13,4 @@ class APIError extends Error {
this.errorMessage = errorMessage;
this.documentationUrl = documentationUrl;
}
}

export default APIError;
}
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const API_BASE_URL = "https://api.screenshotone.com";
const API_TAKE_PATH = "/take";
const API_ANIMATE_PATH = "/animate";

export { APIError };

/**
* Represents an API client for the ScreenshotOne.com API.
*/
Expand Down

0 comments on commit 6cbf4c0

Please sign in to comment.