Can't this be `if (!this.isOAuth2Mode() && options && options['error'])`  ?