diff --git a/src/models/profile/profile.model.ts b/src/models/profile/profile.model.ts index 92b629705..ea5ead150 100644 --- a/src/models/profile/profile.model.ts +++ b/src/models/profile/profile.model.ts @@ -32,7 +32,7 @@ export class Profile { x.checkedUA = obj.checkedUA || {}; if (x.credentials[0] && typeof x.credentials[0] != 'object') - throw ("credentials should be an object"); + throw new Error("credentials should be an object"); return x; }; @@ -74,7 +74,7 @@ export class Profile { public addWallet(credentials: any): boolean { if (!credentials.walletId) - throw 'credentials must have .walletId'; + throw new Error('credentials must have .walletId'); if (this.hasWallet(credentials.walletId)) return false; @@ -86,7 +86,7 @@ export class Profile { public updateWallet(credentials: any): boolean { if (!credentials.walletId) - throw 'credentials must have .walletId'; + throw new Error('credentials must have .walletId'); if (!this.hasWallet(credentials.walletId)) return false; diff --git a/src/providers/profile/profile.ts b/src/providers/profile/profile.ts index 6a2706e5a..c88015979 100644 --- a/src/providers/profile/profile.ts +++ b/src/providers/profile/profile.ts @@ -937,7 +937,7 @@ export class ProfileProvider { public getWallets(opts?: any) { - if (opts && !_.isObject(opts)) throw "bad argument"; + if (opts && !_.isObject(opts)) throw new Error("bad argument"); opts = opts || {}; diff --git a/tslint.json b/tslint.json index 786661c3c..689bde925 100644 --- a/tslint.json +++ b/tslint.json @@ -40,7 +40,6 @@ "curly": false, "object-literal-shorthand": false, "member-access": false, - "no-string-throw": false, "arrow-return-shorthand": false, "array-type": false }