Fix error messages

This commit is contained in:
trojanh 2020-01-21 19:40:20 +05:30
parent 4977c0b163
commit 0c1428471d

View file

@ -508,12 +508,12 @@ export class Disqus implements INodeType {
} catch (error) { } catch (error) {
if (error.statusCode === 401) { if (error.statusCode === 401) {
// Return a clear error // Return a clear error
throw new Error('The Dropbox credentials are not valid!'); throw new Error('The Disqus credentials are not valid!');
} }
if (error.error && error.error.error_summary) { if (error.error && error.error.error_summary) {
// Try to return the error prettier // Try to return the error prettier
throw new Error(`Dropbox error response [${error.statusCode}]: ${error.error.error_summary}`); throw new Error(`Disqus error response [${error.statusCode}]: ${error.error.error_summary}`);
} }
// If that data does not exist for some reason return the actual error // If that data does not exist for some reason return the actual error