screenshotone-api-sdk
Advanced tools
Comparing version
@@ -108,4 +108,9 @@ "use strict"; | ||
} | ||
const data = await response.json(); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
try { | ||
const data = await response.json(); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
} | ||
catch (e) { | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}`); | ||
} | ||
} | ||
@@ -124,4 +129,9 @@ /** | ||
} | ||
const data = await response.json(); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
try { | ||
const data = await response.json(); | ||
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
} | ||
catch (e) { | ||
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}`); | ||
} | ||
} | ||
@@ -128,0 +138,0 @@ /** |
{ | ||
"name": "screenshotone-api-sdk", | ||
"homepage": "https://screenshotone.com", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "Use ScreenshotOne.com API to generate screenshots of any website.", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -95,5 +95,9 @@ import * as crypto from 'crypto'; | ||
const data = await response.json(); | ||
try { | ||
const data = await response.json(); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
} catch (e) { | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}`); | ||
} | ||
} | ||
@@ -114,5 +118,9 @@ | ||
const data = await response.json(); | ||
try { | ||
const data = await response.json(); | ||
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.message}`); | ||
} catch (e) { | ||
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}`); | ||
} | ||
} | ||
@@ -119,0 +127,0 @@ |
94224
0.79%2567
0.71%