Revision 8ddb4627 src/gr/grnet/pithos/web/client/Pithos.java

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

  
355
                    sb.append("Stack trace of original: ");
356
                    sb.append(error.toString());
357
                    sb.append("\n");
358 360
                    StackTraceElement[] stackTrace = error.getStackTrace();
359
                    for(StackTraceElement errorElem : stackTrace) {
360
                        sb.append("  ");
361
                    sb.append("Stack trace (" + stackTrace.length + " elements):\n");
362
                    for(int i = 0; i < stackTrace.length; i++) {
363
                        StackTraceElement errorElem = stackTrace[i];
364
                        sb.append("  [" + i + "] ");
361 365
                        sb.append(errorElem.toString());
362 366
                        sb.append("\n");
363 367
                    }
364 368
                }
369
                else {
370
                    sb.append(arg);
371
                }
365 372
            }
366 373

  
367 374

  
......
614 621
                            scheduleResfresh();
615 622
                        }
616 623
                        else if(retries >= MAX_RETRIES) {
617
                            GWT.log("Error heading folder", t);
624
                            LOG("Error heading folder. ", t);
618 625
                            setError(t);
619 626
                            if(t instanceof RestException) {
620 627
                                displayError("Error heading folder: " + ((RestException) t).getHttpStatusText());
......
624 631
                            }
625 632
                        }
626 633
                        else {//retry
627
                            GWT.log("Retry " + retries);
634
                            LOG("Retry ", retries);
628 635
                            Scheduler.get().scheduleDeferred(this);
629 636
                        }
630 637
                    }
......
761 768

  
762 769
            @Override
763 770
            public void onError(Throwable t) {
764
                GWT.log("Error getting account", t);
771
                LOG("Error getting account", t);
765 772
                setError(t);
766 773
                if(t instanceof RestException) {
767 774
                    displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
......
790 797

  
791 798
            @Override
792 799
            public void onError(Throwable t) {
793
                GWT.log("Error getting account", t);
800
                LOG("Error getting account", t);
794 801
                setError(t);
795 802
                if(t instanceof RestException) {
796 803
                    displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
......
824 831

  
825 832
            @Override
826 833
            public void onError(Throwable t) {
827
                GWT.log("Error creating pithos", t);
834
                LOG("Error creating pithos", t);
828 835
                setError(t);
829 836
                if(t instanceof RestException) {
830 837
                    displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText());
......
853 860

  
854 861
            @Override
855 862
            public void onError(Throwable t) {
856
                GWT.log("Error creating pithos", t);
863
                LOG("Error creating pithos", t);
857 864
                setError(t);
858 865
                if(t instanceof RestException) {
859 866
                    displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText());
......
1038 1045

  
1039 1046
            @Override
1040 1047
            public void onError(Throwable t) {
1041
                GWT.log("", t);
1048
                LOG(t);
1042 1049
                setError(t);
1043 1050
                if(t instanceof RestException) {
1044 1051
                    if(((RestException) t).getHttpStatusCode() != Response.SC_NOT_FOUND) {
......
1074 1081

  
1075 1082
                @Override
1076 1083
                public void onError(Throwable t) {
1077
                    GWT.log("", t);
1084
                    LOG(t);
1078 1085
                    setError(t);
1079 1086
                    if(t instanceof RestException) {
1080 1087
                        displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
......
1114 1121

  
1115 1122
            @Override
1116 1123
            public void onError(Throwable t) {
1117
                GWT.log("", t);
1124
                LOG(t);
1118 1125
                setError(t);
1119 1126
                if(t instanceof RestException) {
1120 1127
                    displayError("Unable to copy folder: " + ((RestException) t).getHttpStatusText());
......
1357 1364

  
1358 1365
                                @Override
1359 1366
                                public void onError(Throwable _t) {
1360
                                    GWT.log("", _t);
1367
                                    LOG(_t);
1361 1368
                                    setError(_t);
1362 1369
                                    if(_t instanceof RestException) {
1363 1370
                                        displayError("Unable to create folder: " + ((RestException) _t).getHttpStatusText());
......
1389 1396
                        displayError("System error heading folder: " + t.getMessage());
1390 1397
                    }
1391 1398

  
1392
                    GWT.log("Error heading folder", t);
1399
                    LOG("Error heading folder", t);
1393 1400
                    setError(t);
1394 1401
                }
1395 1402

  
......
1415 1422

  
1416 1423
            @Override
1417 1424
            public void onError(Throwable t) {
1418
                GWT.log("Error heading file", t);
1425
                LOG("Error heading file", t);
1419 1426
                setError(t);
1420 1427
                if(t instanceof RestException) {
1421 1428
                    displayError("Error heading file: " + ((RestException) t).getHttpStatusText());
......
1516 1523
        fileList.selectByUrl(selectedUrls);
1517 1524
    }
1518 1525

  
1519
    public void emptyContainer(final Folder container) {
1526
    public void purgeContainer(final Folder container) {
1520 1527
        String path = "/" + container.getName() + "?delimiter=/";
1521 1528
        DeleteRequest delete = new DeleteRequest(getApiPath(), getUserID(), path) {
1522 1529

  
......
1532 1539

  
1533 1540
            @Override
1534 1541
            public void onError(Throwable t) {
1535
                GWT.log("Error deleting trash", t);
1542
                LOG("Error deleting trash", t);
1536 1543
                setError(t);
1537 1544
                if(t instanceof RestException) {
1538 1545
                    displayError("Error deleting trash: " + ((RestException) t).getHttpStatusText());

Also available in: Unified diff