This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

tweaked error message print out

  • Loading branch information...
Tim Whitlock
Tim Whitlock committed Nov 20, 2013
1 parent adc1531 commit ddb8c35209727db8e643d702227c227e7a04e5b8
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/twitter.js
View
@@ -256,8 +256,12 @@ TwitterClient.prototype._rest = function( requestMethod, requestPath, requestArg
catch( e ){
error = e;
data = null;
- console.error( 'Twitter responded status '+res.statusCode );
- console.error( e.message || String(e) || 'Unknown error' );
+ if( e.code && e.message ){
+ console.error( 'Twitter responded status '+res.statusCode+', error #'+e.code+', '+e.message );
+ }
+ else {
+ console.error( e.message || String(e) || 'Unknown error' );
+ }
}
if( 'function' === typeof callback ){
callback( data, error, res.statusCode );

0 comments on commit ddb8c35

Please sign in to comment.