From b1e2a94d71dddbb44cc9e7a1ad30bba62c15776f Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 5 Mar 2023 13:44:28 +0100 Subject: [PATCH] Deduplicate QDebug output --- libraries/script-engine/src/ScriptException.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libraries/script-engine/src/ScriptException.h b/libraries/script-engine/src/ScriptException.h index 89a48fa4b2..92ae09617b 100644 --- a/libraries/script-engine/src/ScriptException.h +++ b/libraries/script-engine/src/ScriptException.h @@ -167,15 +167,11 @@ inline QDebug operator<<(QDebug debug, const ScriptException& e) { // Is this a bad practice? inline QDebug operator<<(QDebug debug, std::shared_ptr e) { - debug << "Exception:" - << e->errorMessage - << (e->additionalInfo.isEmpty() ? QString("") : "[" + e->additionalInfo + "]") - << " at line " << e->errorLine << ", column " << e->errorColumn; - - if (e->backtrace.length()) { - debug << "Backtrace:"; - debug << e->backtrace; + if (!e) { + debug << "[Null ScriptException]"; + return debug; } + debug << *e.get(); return debug; } \ No newline at end of file