@metamask-previews/seedless-onboarding-controller 7.1.0-preview-c97d5b99 → 7.1.0-preview-27e39dd44

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
@@ -9,12 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - Add new `SeedlessOnboardingError` class for generic controller errors with support for `cause` and `details` properties ([#7660](https://github.com/MetaMask/core/pull/7660))
13
- - Enables proper error chaining by wrapping underlying errors with additional context
14
- - Includes `toJSON()` method for serialization in logging/transmission
15
-
16
- ### Added
17
-
18
12
  - **BREAKING** The `encryptor` constructor param requires `encryptWithKey` method. ([#7800](https://github.com/MetaMask/core/pull/7800))
19
13
  - The method is to encrypt the vault with cached encryption key while the wallet is unlocked.
20
14
  - Added new public method, `getAccessToken`. ([#7800](https://github.com/MetaMask/core/pull/7800))
@@ -27,8 +21,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
27
21
  - Exclude All the tokens values from the state log explicitly.
28
22
  - Bump `@metamask/keyring-controller` from `^25.0.0` to `^25.1.0` ([#7713](https://github.com/MetaMask/core/pull/7713))
29
23
  - Upgrade `@metamask/utils` from `^11.8.1` to `^11.9.0` ([#7511](https://github.com/MetaMask/core/pull/7511))
30
- - Refactor controller methods to throw `SeedlessOnboardingError` with original error as `cause` for better error tracing ([#7660](https://github.com/MetaMask/core/pull/7660))
31
- - Affected methods: `authenticate`, `changePassword`, `#persistLocalEncryptionKey`, `#fetchAndParseSecretMetadata`, `refreshAuthTokens`
32
24
 
33
25
  ### Fixed
34
26
 
@@ -326,9 +326,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
326
326
  }
327
327
  catch (error) {
328
328
  log('Error authenticating user', error);
329
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.AuthenticationError, {
330
- cause: error,
331
- });
329
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.AuthenticationError);
332
330
  }
333
331
  };
334
332
  return params.skipLock
@@ -504,9 +502,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
504
502
  }
505
503
  catch (error) {
506
504
  log('Error changing password', error);
507
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToChangePassword, {
508
- cause: error,
509
- });
505
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToChangePassword);
510
506
  }
511
507
  });
512
508
  }
@@ -695,9 +691,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
695
691
  })
696
692
  .catch((error) => {
697
693
  log('Error fetching auth pub key', error);
698
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey, {
699
- cause: error,
700
- });
694
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey);
701
695
  });
702
696
  globalAuthPubKey = authPubKey;
703
697
  }
@@ -778,9 +772,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
778
772
  refreshToken,
779
773
  }).catch((error) => {
780
774
  log('Error refreshing JWT tokens', error);
781
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToRefreshJWTTokens, {
782
- cause: error,
783
- });
775
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToRefreshJWTTokens);
784
776
  });
785
777
  try {
786
778
  const { idTokens, accessToken, metadataAccessToken } = res;
@@ -812,9 +804,7 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
812
804
  }
813
805
  catch (error) {
814
806
  log('Error refreshing node auth tokens', error);
815
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.AuthenticationError, {
816
- cause: error,
817
- });
807
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.AuthenticationError);
818
808
  }
819
809
  }
820
810
  /**
@@ -1056,9 +1046,7 @@ async function _SeedlessOnboardingController_persistOprfKey(oprfKey, authPubKey)
1056
1046
  throw error;
1057
1047
  }
1058
1048
  log('Error persisting local encryption key', error);
1059
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToPersistOprfKey, {
1060
- cause: error,
1061
- });
1049
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToPersistOprfKey);
1062
1050
  }
1063
1051
  }, _SeedlessOnboardingController_persistAuthPubKey = function _SeedlessOnboardingController_persistAuthPubKey(params) {
1064
1052
  this.update((state) => {
@@ -1153,9 +1141,7 @@ async function _SeedlessOnboardingController_recoverEncKey(password) {
1153
1141
  if (__classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_isAuthTokenError).call(this, error)) {
1154
1142
  throw error;
1155
1143
  }
1156
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchSecretMetadata, {
1157
- cause: error,
1158
- });
1144
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchSecretMetadata);
1159
1145
  }
1160
1146
  // user must have at least one secret data
1161
1147
  if (secretData?.length > 0) {
@@ -1604,9 +1590,7 @@ async function _SeedlessOnboardingController_assertPasswordInSync(options) {
1604
1590
  })
1605
1591
  .catch((error) => {
1606
1592
  log('Error fetching auth pub key', error);
1607
- throw new errors_1.SeedlessOnboardingError(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey, {
1608
- cause: error,
1609
- });
1593
+ throw new Error(constants_1.SeedlessOnboardingControllerErrorMessage.FailedToFetchAuthPubKey);
1610
1594
  });
1611
1595
  const isPasswordOutdated = await this.checkIsPasswordOutdated({
1612
1596
  ...options,