@bpmsoftwaresolutions/ai-engine-client 1.1.18 → 1.1.19

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +25 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmsoftwaresolutions/ai-engine-client",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "Thin npm client for the AI Engine operator and retrieval APIs",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_TIMEOUT_MS = 30000;
2
- export const AI_ENGINE_CLIENT_VERSION = '1.1.18';
2
+ export const AI_ENGINE_CLIENT_VERSION = '1.1.19';
3
3
  export const GOVERNED_MUTATION_REQUIRED_CAPABILITIES = [
4
4
  'executeVerifiedMutation',
5
5
  'post_mutation_verification',
@@ -2135,6 +2135,14 @@ export class AIEngineClient {
2135
2135
  throw error;
2136
2136
  }
2137
2137
  return payload;
2138
+ } catch (error) {
2139
+ if (error?.name === 'AbortError') {
2140
+ const timeoutError = new Error(`Request to ${url.pathname} timed out after ${this.timeoutMs}ms.`);
2141
+ timeoutError.code = 'REQUEST_TIMEOUT';
2142
+ timeoutError.status = 0;
2143
+ throw timeoutError;
2144
+ }
2145
+ throw error;
2138
2146
  } finally {
2139
2147
  clearTimeout(timeoutHandle);
2140
2148
  }
@@ -2173,6 +2181,14 @@ export class AIEngineClient {
2173
2181
  fileName: parseContentDispositionFilename(contentDisposition),
2174
2182
  headers: Object.fromEntries(response.headers.entries()),
2175
2183
  };
2184
+ } catch (error) {
2185
+ if (error?.name === 'AbortError') {
2186
+ const timeoutError = new Error(`Request to ${url.pathname} timed out after ${this.timeoutMs}ms.`);
2187
+ timeoutError.code = 'REQUEST_TIMEOUT';
2188
+ timeoutError.status = 0;
2189
+ throw timeoutError;
2190
+ }
2191
+ throw error;
2176
2192
  } finally {
2177
2193
  clearTimeout(timeoutHandle);
2178
2194
  }
@@ -2219,6 +2235,14 @@ export class AIEngineClient {
2219
2235
  contentType,
2220
2236
  fileName: parseContentDispositionFilename(contentDisposition),
2221
2237
  };
2238
+ } catch (error) {
2239
+ if (error?.name === 'AbortError') {
2240
+ const timeoutError = new Error(`Request to ${url.pathname} timed out after ${this.timeoutMs}ms.`);
2241
+ timeoutError.code = 'REQUEST_TIMEOUT';
2242
+ timeoutError.status = 0;
2243
+ throw timeoutError;
2244
+ }
2245
+ throw error;
2222
2246
  } finally {
2223
2247
  clearTimeout(timeoutHandle);
2224
2248
  }