Fix echo statements not showing up in debug modals or console trace

This was accidentially introduced in the recent Application permissions refactor, where `formattedError`was changed to always be a string array.
This commit is contained in:
Alexander Skvortsov 2022-01-04 21:13:00 -05:00
parent 7982dcd578
commit 2afe93a02c
2 changed files with 6 additions and 2 deletions

View File

@ -547,7 +547,11 @@ export default class Application {
console.group(`${method} ${url} ${status}`);
console.error(...(formattedErrors || [e]));
if (formattedErrors.length) {
console.error(...formattedErrors);
} else {
console.error(e)
}
console.groupEnd();
}

View File

@ -22,7 +22,7 @@ export default class RequestErrorModal<CustomAttrs extends IRequestErrorModalAtt
// If the error is already formatted, just add line endings;
// else try to parse it as JSON and stringify it with indentation
if (formattedError) {
if (formattedError.length) {
responseText = formattedError.join('\n\n');
} else if (error.response) {
responseText = JSON.stringify(error.response, null, 2);