Revision 01337c33

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
            }
b/src/gr/grnet/pithos/web/client/catalog/GetUserCatalogs.java
42 42
import com.google.gwt.json.client.JSONObject;
43 43
import com.google.gwt.json.client.JSONParser;
44 44
import com.google.gwt.json.client.JSONValue;
45
import gr.grnet.pithos.web.client.Const;
45 46
import gr.grnet.pithos.web.client.Helpers;
46 47
import gr.grnet.pithos.web.client.Pithos;
47 48

  
......
51 52
 * The request via which we obtain user catalog info.
52 53
 */
53 54
public class GetUserCatalogs implements Scheduler.ScheduledCommand {
55
    private final Pithos app;
54 56
    private final String url;
55 57
    private final String userToken;
56 58
    private final List<String> ids;
......
78 80
    public GetUserCatalogs(Pithos app, List<String> ids, List<String> names) {
79 81
        assert app != null;
80 82

  
83
        this.app = app;
84

  
81 85
        // FIXME: Probably use Window.Location.getHost()
82 86
        // https://server.com/v1/ --> https://server.com
83 87
        String path = app.getApiPath();
......
133 137
    }
134 138

  
135 139
    public void onError(Request request, Throwable t) {
136
        GWT.log("GetUserCatalogs", t);
140
        app.LOG("GetUserCatalogs ", t);
137 141
    }
138 142

  
139 143
    @Override
140 144
    public void execute() {
141 145
        final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, getURL());
142
        rb.setHeader("X-Auth-Token", userToken);
146
        rb.setHeader(Const.X_AUTH_TOKEN, userToken);
143 147
        final String requestData = makeRequestData().toString();
148
        app.LOG("GetUserCatalog => ", requestData);
149
        app.LOG(new Exception());
144 150

  
145 151
        try {
146 152
            rb.sendRequest(requestData, new RequestCallback() {
......
149 155
                    final int statusCode = response.getStatusCode();
150 156

  
151 157
                    if(statusCode != SuccessCode) {
158
                        app.LOG("GetUserCatalog <= [", statusCode, " ", response.getStatusText(), "]");
152 159
                        GetUserCatalogs.this.onBadStatusCode(request, response);
153 160
                        return;
154 161
                    }
155 162

  
156 163
                    final String responseText = response.getText();
157 164
                    final JSONValue jsonValue = JSONParser.parseStrict(responseText);
165
                    app.LOG("GetUserCatalog <= ", jsonValue.toString());
158 166
                    final JSONObject result = jsonValue.isObject();
159 167

  
160 168
                    if(result == null) {
......
174 182
            });
175 183
        }
176 184
        catch(Exception e) {
177
            GWT.log("GetUserCatalogs", e);
185
            app.LOG("GetUserCatalogs. ", e);
178 186
        }
179 187
    }
180 188

  

Also available in: Unified diff