spotify-web-api-node icon indicating copy to clipboard operation
spotify-web-api-node copied to clipboard

[WebApiError] Error message type should be a string.

Open acantepie opened this issue 3 years ago • 1 comments

Hi,

Error message triggered by library should be a string, not an object.

The following code is the cause of the problem :

https://github.com/thelinmichael/spotify-web-api-node/blob/master/src/http-manager.js#L47

  /* Other type of error, or unhandled Web API error format */
  return new WebapiError(response.body, response.headers, response.statusCode, response.body);

https://github.com/thelinmichael/spotify-web-api-node/blob/master/src/response-error.js#L17

class WebapiError extends NamedError {
  constructor(body, headers, statusCode, message) {
    super(message);
    this.body = body;
    this.headers = headers;
    this.statusCode = statusCode;
  }

acantepie avatar Nov 26 '22 19:11 acantepie

+1

ameetmadan avatar Mar 14 '23 21:03 ameetmadan