👕 Fix built issue by fixing lint issues

This commit is contained in:
Jan Oberhauser
2020-10-01 14:01:39 +02:00
parent 9b5731450f
commit fe802c8f76
165 changed files with 1930 additions and 1864 deletions

View File

@@ -48,17 +48,17 @@ export async function spotifyApiRequest(this: IHookFunctions | IExecuteFunctions
return await this.helpers.requestOAuth2.call(this, 'spotifyOAuth2Api', options);
} catch (error) {
if (error.statusCode === 401) {
// Return a clear error
throw new Error('The Spotify credentials are not valid!');
}
// Return a clear error
throw new Error('The Spotify credentials are not valid!');
}
if (error.error && error.error.error && error.error.error.message) {
// Try to return the error prettier
throw new Error(`Spotify error response [${error.error.error.status}]: ${error.error.error.message}`);
}
if (error.error && error.error.error && error.error.error.message) {
// Try to return the error prettier
throw new Error(`Spotify error response [${error.error.error.status}]: ${error.error.error.message}`);
}
// If that data does not exist for some reason return the actual error
throw error;
// If that data does not exist for some reason return the actual error
throw error;
}
}