mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
don't try to print null exception trace in printTrace
It is possible to create an Exception with no stack trace by overriding Throwable.fillInStackTrace, so we can't assume any given instance will have one.
This commit is contained in:
parent
4db79b9be6
commit
8fb9523de5
@ -3904,26 +3904,28 @@ printTrace(Thread* t, object exception)
|
|||||||
}
|
}
|
||||||
|
|
||||||
object trace = throwableTrace(t, e);
|
object trace = throwableTrace(t, e);
|
||||||
for (unsigned i = 0; i < objectArrayLength(t, trace); ++i) {
|
if (trace) {
|
||||||
object e = objectArrayBody(t, trace, i);
|
for (unsigned i = 0; i < objectArrayLength(t, trace); ++i) {
|
||||||
const int8_t* class_ = &byteArrayBody
|
object e = objectArrayBody(t, trace, i);
|
||||||
(t, className(t, methodClass(t, traceElementMethod(t, e))), 0);
|
const int8_t* class_ = &byteArrayBody
|
||||||
const int8_t* method = &byteArrayBody
|
(t, className(t, methodClass(t, traceElementMethod(t, e))), 0);
|
||||||
(t, methodName(t, traceElementMethod(t, e)), 0);
|
const int8_t* method = &byteArrayBody
|
||||||
int line = t->m->processor->lineNumber
|
(t, methodName(t, traceElementMethod(t, e)), 0);
|
||||||
(t, traceElementMethod(t, e), traceElementIp(t, e));
|
int line = t->m->processor->lineNumber
|
||||||
|
(t, traceElementMethod(t, e), traceElementIp(t, e));
|
||||||
|
|
||||||
fprintf(stderr, " at %s.%s ", class_, method);
|
fprintf(stderr, " at %s.%s ", class_, method);
|
||||||
|
|
||||||
switch (line) {
|
switch (line) {
|
||||||
case NativeLine:
|
case NativeLine:
|
||||||
fprintf(stderr, "(native)\n");
|
fprintf(stderr, "(native)\n");
|
||||||
break;
|
break;
|
||||||
case UnknownLine:
|
case UnknownLine:
|
||||||
fprintf(stderr, "(unknown line)\n");
|
fprintf(stderr, "(unknown line)\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "(line %d)\n", line);
|
fprintf(stderr, "(line %d)\n", line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user