How to use @accounts/error - 3 common examples

To help you get started, we’ve selected a few @accounts/error examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github accounts-js / accounts / packages / token-manager / src / token-manager.ts View on Github external
private validateConfiguration(config: Configuration): void {
    if (!config) {
      throw new AccountsError('TokenManager', 'configuration', 'A configuration object is needed');
    }
    if (typeof config.secret !== 'string') {
      throw new AccountsError('TokenManager', 'configuration', 'A string secret property is needed');
    }
  }
}
github accounts-js / accounts / packages / token-manager / src / token-manager.ts View on Github external
private validateConfiguration(config: Configuration): void {
    if (!config) {
      throw new AccountsError('TokenManager', 'configuration', 'A configuration object is needed');
    }
    if (typeof config.secret !== 'string') {
      throw new AccountsError('TokenManager', 'configuration', 'A string secret property is needed');
    }
  }
}
github accounts-js / accounts / packages / email-ns-debug / src / email-ns-debug.ts View on Github external
public notify (notificationPluginName: string, actionName: string, params: object): void {
    const plugin = this.plugins[notificationPluginName];
    if(!plugin){
      throw new AccountsError('EmailNotificationServiceDebug','notify',`The plugin "${notificationPluginName}" is not registered`)
    }
    const action = plugin[actionName];
    if(!action){
      throw new AccountsError('EmailNotificationServiceDebug','notify',`The action "${actionName}" is not found on plugin "${notificationPluginName}"`)
    }
    action(this.send, params);
  }

@accounts/error

Accounts-js Error

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular @accounts/error functions