@medialane/sdk 0.128.0 → 0.129.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,12 +248,11 @@ function deriveErrorCode(status) {
248
248
  return "UNKNOWN";
249
249
  }
250
250
  var MedialaneApiError = class extends Error {
251
- constructor(status, message, retryAfterMs, details, isAuthored = false) {
251
+ constructor(status, message, retryAfterMs, details) {
252
252
  super(message);
253
253
  this.status = status;
254
254
  this.retryAfterMs = retryAfterMs;
255
255
  this.details = details;
256
- this.isAuthored = isAuthored;
257
256
  this.name = "MedialaneApiError";
258
257
  this.code = deriveErrorCode(status);
259
258
  }
@@ -290,14 +289,12 @@ var ApiClient = class {
290
289
  });
291
290
  if (!response.ok && !allowed(response.status)) {
292
291
  const text = await response.text().catch(() => response.statusText);
293
- let message = text;
294
- let details;
295
- let isAuthored = false;
292
+ let message = `Request failed with status ${response.status}`;
293
+ let details = text;
296
294
  try {
297
295
  const body = JSON.parse(text);
298
296
  if (typeof body.error === "string" && body.error.trim() !== "") {
299
297
  message = body.error;
300
- isAuthored = true;
301
298
  }
302
299
  details = body;
303
300
  } catch {
@@ -306,8 +303,7 @@ var ApiClient = class {
306
303
  response.status,
307
304
  message,
308
305
  parseRetryAfter(response.headers.get("retry-after")),
309
- details,
310
- isAuthored
306
+ details
311
307
  );
312
308
  }
313
309
  return response;