spotify-web-api-node
spotify-web-api-node copied to clipboard
[WebApiError] Error message type should be a string.
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;
}
+1