@aptly-as/types
Advanced tools
Comparing version 2.8.0 to 2.8.1
@@ -6,4 +6,8 @@ export class AptlyError extends Error { | ||
static async fromResponse(response) { | ||
if (response.headers.get('content-type') !== 'application/json') { | ||
const contentType = response.headers.get('content-type'); | ||
if (contentType?.includes('application/json')) { | ||
const body = await response.json(); | ||
if (!body.link) { | ||
body.link = response.url; | ||
} | ||
if (body.name === AptlyError.name) { | ||
@@ -10,0 +14,0 @@ return new AptlyError(body); |
{ | ||
"name": "@aptly-as/types", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"description": "Aptly types and enums", | ||
@@ -5,0 +5,0 @@ "type": "module", |
114325
3131