Deduplicate QDebug output

This commit is contained in:
Dale Glass 2023-03-05 13:44:28 +01:00 committed by ksuprynowicz
parent 8d6270392d
commit b1e2a94d71

View file

@ -167,15 +167,11 @@ inline QDebug operator<<(QDebug debug, const ScriptException& e) {
// Is this a bad practice? // Is this a bad practice?
inline QDebug operator<<(QDebug debug, std::shared_ptr<ScriptException> e) { inline QDebug operator<<(QDebug debug, std::shared_ptr<ScriptException> e) {
debug << "Exception:" if (!e) {
<< e->errorMessage debug << "[Null ScriptException]";
<< (e->additionalInfo.isEmpty() ? QString("") : "[" + e->additionalInfo + "]") return debug;
<< " at line " << e->errorLine << ", column " << e->errorColumn;
if (e->backtrace.length()) {
debug << "Backtrace:";
debug << e->backtrace;
} }
debug << *e.get();
return debug; return debug;
} }