videomail-client 10.0.1 → 10.0.3

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.
package/dist/index.cjs CHANGED
@@ -3920,9 +3920,7 @@ function __webpack_require__(moduleId) {
3920
3920
  let err = errorParams.err;
3921
3921
  var _errorParams_classList;
3922
3922
  const classList = null !== (_errorParams_classList = errorParams.classList) && void 0 !== _errorParams_classList ? _errorParams_classList : [];
3923
- if (exc instanceof Error) {
3924
- if (!err) err = exc;
3925
- }
3923
+ if (!err && exc instanceof Error) err = exc;
3926
3924
  if (err instanceof error_VideomailError) return err;
3927
3925
  const audioEnabled = isAudioEnabled(options);
3928
3926
  const browser = getBrowser(options);
@@ -4462,6 +4460,25 @@ function __webpack_require__(moduleId) {
4462
4460
  else obj[key] = value;
4463
4461
  return obj;
4464
4462
  }
4463
+ function findOriginalExc(exc) {
4464
+ if (exc instanceof Error && "response" in exc) {
4465
+ const response = exc.response;
4466
+ const body = response.body;
4467
+ if ("error" in body) {
4468
+ const message = body.error.message;
4469
+ const name = body.error.name;
4470
+ const stack = body.error.stack;
4471
+ const cause = body.error.cause;
4472
+ const error = new Error(message, {
4473
+ cause
4474
+ });
4475
+ error.name = name;
4476
+ error.stack = stack;
4477
+ return error;
4478
+ }
4479
+ }
4480
+ return exc;
4481
+ }
4465
4482
  class Resource {
4466
4483
  applyDefaultValue(videomail, name) {
4467
4484
  if (this.options.defaults[name] && !videomail[name]) videomail[name] = this.options.defaults[name];
@@ -4487,7 +4504,7 @@ function __webpack_require__(moduleId) {
4487
4504
  return videomail;
4488
4505
  } catch (exc) {
4489
4506
  throw error_createError({
4490
- exc,
4507
+ exc: findOriginalExc(exc),
4491
4508
  options: this.options
4492
4509
  });
4493
4510
  }
@@ -4503,7 +4520,7 @@ function __webpack_require__(moduleId) {
4503
4520
  return request;
4504
4521
  } catch (exc) {
4505
4522
  throw error_createError({
4506
- exc,
4523
+ exc: findOriginalExc(exc),
4507
4524
  options: this.options
4508
4525
  });
4509
4526
  }
@@ -4541,7 +4558,7 @@ function __webpack_require__(moduleId) {
4541
4558
  return res;
4542
4559
  } catch (exc) {
4543
4560
  throw error_createError({
4544
- exc,
4561
+ exc: findOriginalExc(exc),
4545
4562
  options: this.options
4546
4563
  });
4547
4564
  }
@@ -4569,7 +4586,7 @@ function __webpack_require__(moduleId) {
4569
4586
  return res;
4570
4587
  } catch (exc) {
4571
4588
  throw error_createError({
4572
- exc,
4589
+ exc: findOriginalExc(exc),
4573
4590
  options: this.options
4574
4591
  });
4575
4592
  }
@@ -5794,7 +5811,7 @@ function __webpack_require__(moduleId) {
5794
5811
  const external_is_power_of_two_namespaceObject = require("is-power-of-two");
5795
5812
  var external_is_power_of_two_default = /*#__PURE__*/ __webpack_require__.n(external_is_power_of_two_namespaceObject);
5796
5813
  var package_namespaceObject = {
5797
- i8: "10.0.0"
5814
+ i8: "10.0.2"
5798
5815
  }; // CONCATENATED MODULE: ./src/types/env.ts
5799
5816
  // ... and these actually define the runtime mode of Node.js and are
5800
5817
  // set either in package.json, via Jest or in the Dockerfile
package/dist/index.js CHANGED
@@ -3858,9 +3858,7 @@ function createError(errorParams) {
3858
3858
  let explanation = errorParams.explanation;
3859
3859
  let err = errorParams.err;
3860
3860
  const classList = errorParams.classList ?? [];
3861
- if (exc instanceof Error) {
3862
- if (!err) err = exc;
3863
- }
3861
+ if (!err && exc instanceof Error) err = exc;
3864
3862
  if (err instanceof error_VideomailError) return err;
3865
3863
  const audioEnabled = isAudioEnabled(options);
3866
3864
  const browser = getBrowser(options);
@@ -4364,6 +4362,25 @@ class Form extends util_Despot {
4364
4362
  }
4365
4363
  }
4366
4364
  /* ESM default export */ const wrappers_form = Form;
4365
+ function findOriginalExc(exc) {
4366
+ if (exc instanceof Error && "response" in exc) {
4367
+ const response = exc.response;
4368
+ const body = response.body;
4369
+ if ("error" in body) {
4370
+ const message = body.error.message;
4371
+ const name = body.error.name;
4372
+ const stack = body.error.stack;
4373
+ const cause = body.error.cause;
4374
+ const error = new Error(message, {
4375
+ cause
4376
+ });
4377
+ error.name = name;
4378
+ error.stack = stack;
4379
+ return error;
4380
+ }
4381
+ }
4382
+ return exc;
4383
+ }
4367
4384
  class Resource {
4368
4385
  options;
4369
4386
  timezoneId;
@@ -4395,7 +4412,7 @@ class Resource {
4395
4412
  return videomail;
4396
4413
  } catch (exc) {
4397
4414
  throw error_createError({
4398
- exc,
4415
+ exc: findOriginalExc(exc),
4399
4416
  options: this.options
4400
4417
  });
4401
4418
  }
@@ -4411,7 +4428,7 @@ class Resource {
4411
4428
  return request;
4412
4429
  } catch (exc) {
4413
4430
  throw error_createError({
4414
- exc,
4431
+ exc: findOriginalExc(exc),
4415
4432
  options: this.options
4416
4433
  });
4417
4434
  }
@@ -4449,7 +4466,7 @@ class Resource {
4449
4466
  return res;
4450
4467
  } catch (exc) {
4451
4468
  throw error_createError({
4452
- exc,
4469
+ exc: findOriginalExc(exc),
4453
4470
  options: this.options
4454
4471
  });
4455
4472
  }
@@ -4477,7 +4494,7 @@ class Resource {
4477
4494
  return res;
4478
4495
  } catch (exc) {
4479
4496
  throw error_createError({
4480
- exc,
4497
+ exc: findOriginalExc(exc),
4481
4498
  options: this.options
4482
4499
  });
4483
4500
  }
@@ -5579,7 +5596,7 @@ function isPromise_isPromise(anything) {
5579
5596
  }
5580
5597
  /* ESM default export */ const isPromise = isPromise_isPromise;
5581
5598
  var package_namespaceObject = {
5582
- i8: "10.0.0"
5599
+ i8: "10.0.2"
5583
5600
  }; // CONCATENATED MODULE: ./src/types/env.ts
5584
5601
  // ... and these actually define the runtime mode of Node.js and are
5585
5602
  // set either in package.json, via Jest or in the Dockerfile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "videomail-client",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
4
4
  "description": "A wicked npm package to record videos directly in the browser, wohooo!",
5
5
  "keywords": [
6
6
  "webcam",
@@ -74,17 +74,17 @@
74
74
  "@chromatic-com/storybook": "3.2.2",
75
75
  "@eslint/js": "9.14.0",
76
76
  "@rsbuild/plugin-node-polyfill": "1.2.0",
77
- "@rsbuild/plugin-stylus": "1.0.5",
77
+ "@rsbuild/plugin-stylus": "1.0.6",
78
78
  "@rsdoctor/rspack-plugin": "0.4.8",
79
79
  "@rslib/core": "0.0.18",
80
- "@storybook/addon-a11y": "8.4.2",
80
+ "@storybook/addon-a11y": "8.4.4",
81
81
  "@storybook/addon-console": "3.0.0",
82
- "@storybook/addon-essentials": "8.4.2",
83
- "@storybook/addon-interactions": "8.4.2",
84
- "@storybook/addon-links": "8.4.2",
85
- "@storybook/html": "8.4.2",
86
- "@storybook/manager-api": "8.4.2",
87
- "@storybook/theming": "8.4.2",
82
+ "@storybook/addon-essentials": "8.4.4",
83
+ "@storybook/addon-interactions": "8.4.4",
84
+ "@storybook/addon-links": "8.4.4",
85
+ "@storybook/html": "8.4.4",
86
+ "@storybook/manager-api": "8.4.4",
87
+ "@storybook/theming": "8.4.4",
88
88
  "@tsconfig/node22": "22.0.0",
89
89
  "@tsconfig/strictest": "2.0.5",
90
90
  "@types/defined": "1.0.2",
@@ -100,7 +100,7 @@
100
100
  "eslint-plugin-depend": "0.12.0",
101
101
  "eslint-plugin-import-x": "4.4.2",
102
102
  "eslint-plugin-promise": "7.1.0",
103
- "eslint-plugin-regexp": "2.6.0",
103
+ "eslint-plugin-regexp": "2.7.0",
104
104
  "eslint-plugin-security": "3.0.1",
105
105
  "eslint-plugin-storybook": "0.11.0",
106
106
  "globals": "15.12.0",
@@ -112,11 +112,11 @@
112
112
  "prettier-plugin-packagejson": "2.5.3",
113
113
  "prettier-plugin-sh": "0.14.0",
114
114
  "release-it": "17.10.0",
115
- "storybook": "8.4.2",
115
+ "storybook": "8.4.4",
116
116
  "storybook-html-rsbuild": "0.1.4",
117
117
  "typescript": "5.6.3",
118
118
  "typescript-eslint": "8.14.0",
119
- "vitest": "2.1.4"
119
+ "vitest": "2.1.5"
120
120
  },
121
121
  "engines": {
122
122
  "node": "^22.8.0",