// INTERFACE ==================================================================================
public DataArray collect(final Throwable th) {
if (th == null) return null;
final DataArray excps = createDataArr();
{
Throwable t = th;
while (t != null) {
final DataObject excp = createDataObj();
{
excp.put("message", simplifyMessage(t.getMessage()));
excp.put("class", t.getClass().getName());
final DataArray trace = createDataArr();
for (final StackTraceElement element : t.getStackTrace()) {
final int line = element.getLineNumber();
final String method = element.getMethodName();
final String file = element.getFileName();
final String cls = element.getClassName();
trace.add(cls + ':' + file + ":" + method + ":" + line);
}
excp.put("stacktrace", trace);
}
excps.add(excp);
t = t.getCause();