Revision 01337c33 src/gr/grnet/pithos/web/client/Pithos.java

b/src/gr/grnet/pithos/web/client/Pithos.java
341 341
            final StringBuilder sb = new StringBuilder();
342 342
            for(Object arg : args) {
343 343
                sb.append(arg);
344
                if(arg instanceof Throwable) {
345
                    sb.append("\nCauses (including original):\n");
346
                    final Throwable error = (Throwable) arg;
347
                    Throwable cause = error;
348
                    while(cause != null) {
349
                        sb.append("  ");
350
                        sb.append(cause.toString());
351
                        sb.append("\n");
352
                        cause = cause.getCause();
353
                    }
354

  
355
                    sb.append("Stack trace of original: ");
356
                    sb.append(error.toString());
357
                    sb.append("\n");
358
                    StackTraceElement[] stackTrace = error.getStackTrace();
359
                    for(StackTraceElement errorElem : stackTrace) {
360
                        sb.append("  ");
361
                        sb.append(errorElem.toString());
362
                        sb.append("\n");
363
                    }
364
                }
344 365
            }
366

  
367

  
345 368
            if(sb.length() > 0) {
346 369
                __ConsoleLog(sb.toString());
347 370
            }

Also available in: Unified diff