@go-avro/avro-js 0.0.79 → 0.0.80

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.
@@ -60,14 +60,16 @@ AvroQueryClient.prototype._fetch = async function (method, path, body, cancelTok
60
60
  return this._fetch(method, path, body, cancelToken, headers, isIdempotent, retryCount + 1);
61
61
  }
62
62
  let errorMessage = response.statusText;
63
+ let errorBody;
63
64
  try {
64
65
  const parsedError = await response.json();
66
+ errorBody = parsedError;
65
67
  errorMessage = parsedError.message ?? parsedError.msg ?? errorMessage;
66
68
  }
67
69
  catch (e) {
68
70
  console.error('Ignoring:', e);
69
71
  }
70
- throw new StandardError(response.status, errorMessage);
72
+ throw new StandardError(response.status, errorMessage, errorBody);
71
73
  }
72
74
  catch (error) {
73
75
  if (error instanceof StandardError) {
@@ -40,6 +40,7 @@ declare module '../../types/api/Task' {
40
40
  bill_mode: 'MONTH' | 'SERVICE' | 'NONE';
41
41
  autobill: boolean;
42
42
  price: number;
43
+ last_unrouted_reason: 'NOT_DUE' | 'DEPENDENCY_UNMET' | 'MISSING_SKILLS' | 'OVER_CAPACITY' | 'TRAVEL_TIME' | 'LOW_PRIORITY' | 'DID_NOT_FIT' | null;
43
44
  services_remaining: number;
44
45
  activate_on: number | null;
45
46
  expire_on: number | null;
@@ -1,4 +1,5 @@
1
1
  export declare class StandardError extends Error {
2
2
  status: number;
3
- constructor(status: number, message: string);
3
+ body?: unknown;
4
+ constructor(status: number, message: string, body?: unknown);
4
5
  }
@@ -1,7 +1,8 @@
1
1
  export class StandardError extends Error {
2
- constructor(status, message) {
2
+ constructor(status, message, body) {
3
3
  super(message);
4
4
  this.status = status;
5
+ this.body = body;
5
6
  Object.setPrototypeOf(this, StandardError.prototype);
6
7
  }
7
8
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "0.0.79";
1
+ export declare const AVRO_JS_VERSION = "0.0.80";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '0.0.79';
3
+ export const AVRO_JS_VERSION = '0.0.80';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.79",
3
+ "version": "0.0.80",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",