lib/error.js
function SpotifyError (err) {
  this.domain = err[0] || 0;
  this.code = err[1] || 0;
  this.description = err[2] || '';
  this.data = err[3] || null;

  // Error impl
  this.name = domains[this.domain];
  var msg = codes[this.code];
  if (this.description) msg += ' (' + this.description + ')';
  this.message = msg;
  Error.captureStackTrace(this, SpotifyError);
}
function SpotifyError (err) {
  this.domain = err[0] || 0;
  this.code = err[1] || 0;
  this.description = err[2] || '';
  this.data = err[3] || null;

  // Error impl
  this.name = domains[this.domain];
  var msg = codes[this.code];
  if (this.description) msg += ' (' + this.description + ')';
  this.message = msg;
  Error.captureStackTrace(this, SpotifyError);
}
function SpotifyError ( err ) { this . domain = err [ 0 ] || 0 ; this . code = err [ 1 ] || 0 ; this . description = err [ 2 ] || '' ; this . data = err [ 3 ] || null ; // Error impl this . name = domains [ this . domain ] ; var msg = codes [ this . code ] ; if ( this . description ) msg += ' (' + this . description + ')' ; this . message = msg ; Error . captureStackTrace ( this , SpotifyError ) ; }
Spotify error class.

Sample `err` objects:

[ 11, 1, 'Invalid user' ]
[ 12, 8, '' ]
[ 14, 408, '' ]
[ 14, 429, '' ]
Spotify error class .