Пример #1
0
CString ExceptionScope::unexpectedExceptionMessage()
{
    StringPrintStream out;

    out.println("Unexpected exception observed on thread ", currentThread(), " at:");
    auto currentStack = StackTrace::captureStackTrace(Options::unexpectedExceptionStackTraceLimit(), 1);
    currentStack->dump(out, "    ");

    if (!m_vm.nativeStackTraceOfLastThrow())
        return CString();

    out.println("The exception was thrown from thread ", m_vm.throwingThread(), " at:");
    m_vm.nativeStackTraceOfLastThrow()->dump(out, "    ");

    return out.toCString();
}