@metamask/snaps-controllers 15.0.0 → 15.0.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [15.0.1]
11
+
12
+ ### Fixed
13
+
14
+ - Stop creating errors before needing to throw ([#3664](https://github.com/MetaMask/snaps/pull/3664))
15
+
10
16
  ## [15.0.0]
11
17
 
12
18
  ### Added
@@ -911,7 +917,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
911
917
  - The version of the package no longer needs to match the version of all other
912
918
  MetaMask Snaps packages.
913
919
 
914
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@15.0.0...HEAD
920
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@15.0.1...HEAD
921
+ [15.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@15.0.0...@metamask/snaps-controllers@15.0.1
915
922
  [15.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@14.2.2...@metamask/snaps-controllers@15.0.0
916
923
  [14.2.2]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@14.2.1...@metamask/snaps-controllers@14.2.2
917
924
  [14.2.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@14.2.0...@metamask/snaps-controllers@14.2.1
@@ -713,7 +713,7 @@ class SnapController extends base_controller_1.BaseController {
713
713
  */
714
714
  getExpect(snapId) {
715
715
  const snap = this.get(snapId);
716
- (0, utils_1.assert)(snap !== undefined, new Error(`Snap "${snapId}" not found.`));
716
+ (0, utils_1.assert)(snap !== undefined, `Snap "${snapId}" not found.`);
717
717
  return snap;
718
718
  }
719
719
  /**
@@ -2201,14 +2201,14 @@ class SnapController extends base_controller_1.BaseController {
2201
2201
  * @returns A `RollbackSnapshot`.
2202
2202
  */
2203
2203
  #createRollbackSnapshot(snapId) {
2204
- (0, utils_1.assert)(this.#rollbackSnapshots.get(snapId) === undefined, new Error(`Snap "${snapId}" rollback snapshot already exists.`));
2204
+ (0, utils_1.assert)(this.#rollbackSnapshots.get(snapId) === undefined, `Snap "${snapId}" rollback snapshot already exists.`);
2205
2205
  this.#rollbackSnapshots.set(snapId, {
2206
2206
  statePatches: [],
2207
2207
  permissions: {},
2208
2208
  newVersion: '',
2209
2209
  });
2210
2210
  const newRollbackSnapshot = this.#rollbackSnapshots.get(snapId);
2211
- (0, utils_1.assert)(newRollbackSnapshot !== undefined, new Error(`Snapshot creation failed for ${snapId}.`));
2211
+ (0, utils_1.assert)(newRollbackSnapshot !== undefined, `Snapshot creation failed for ${snapId}.`);
2212
2212
  return newRollbackSnapshot;
2213
2213
  }
2214
2214
  /**
@@ -2271,7 +2271,7 @@ class SnapController extends base_controller_1.BaseController {
2271
2271
  }
2272
2272
  #getRuntimeExpect(snapId) {
2273
2273
  const runtime = this.#getRuntime(snapId);
2274
- (0, utils_1.assert)(runtime !== undefined, new Error(`Snap "${snapId}" runtime data not found`));
2274
+ (0, utils_1.assert)(runtime !== undefined, `Snap "${snapId}" runtime data not found`);
2275
2275
  return runtime;
2276
2276
  }
2277
2277
  #setupRuntime(snapId) {