fix(long-connection): Throw error for reporting, instead of just logging

This commit is contained in:
Juan Tejada 2016-09-19 19:36:32 -07:00
parent 5f8bb9dffd
commit 6eea9d26f1

View file

@ -112,8 +112,7 @@ class NylasLongConnection {
const accountToken = this._api.accessTokenForAccountId(this._accountId) const accountToken = this._api.accessTokenForAccountId(this._accountId)
const identityToken = (IdentityStore.identity() || {}).token || '' const identityToken = (IdentityStore.identity() || {}).token || ''
if (!accountToken) { if (!accountToken) {
console.error(`Can't establish NylasLongConnection: No account token available for account ${this._accountId}`) throw new Error(`Can't establish NylasLongConnection: No account token available for account ${this._accountId}`)
return this;
} }
const options = url.parse(`${this._api.APIRoot}${this._path}`) const options = url.parse(`${this._api.APIRoot}${this._path}`)