Project

General

Profile

Revision ce2778dd

IDce2778ddae41b24a9c8bc8ac702ea4fa212d42ec
Parent ee7d980d
Child 3b7ab2f9

Added by Cherian Mathew about 7 years ago

added caused by to multistatus error dialog

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
184 184
    private static void errorDialog(final String title,
185 185
            final Object source,
186 186
            final Throwable t,
187
            final String message,
187 188
            final MultiStatus status) {
188 189

  
189 190
        Display.getDefault().asyncExec(new Runnable() {
190 191

  
191 192
            @Override
192 193
            public void run() {
193
                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, t.getMessage(), status);
194
                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
194 195
                ced.open();
195 196
                Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
196 197

  
......
201 202
                t.printStackTrace(new PrintWriter(sw));
202 203
                IStatus singleStatus = new Status(IStatus.ERROR,
203 204
                        status.getPlugin(),
204
                        status.getMessage(),
205
                        message,
205 206
                        new Exception(sw.toString()));
206 207

  
207 208
                error(clazz, singleStatus);
......
237 238
            childStatuses.add(new Status(IStatus.ERROR, pluginId, "at " + ste.toString()));
238 239
        }
239 240

  
241
        if(t.getCause() != null) {
242
            childStatuses.add(new Status(IStatus.ERROR, pluginId, ""));
243
            childStatuses.add(new Status(IStatus.ERROR, pluginId, "Caused by : " + t.getCause().toString()));
244
            for (StackTraceElement ste : t.getCause().getStackTrace()) {
245
                // build & add status
246
                childStatuses.add(new Status(IStatus.ERROR, pluginId, "at " + ste.toString()));
247
            }
248
        }
249

  
240 250
        // build message with contact info
241 251
        String finalMessage = message;
242 252

  
......
251 261
        MultiStatus ms = new MultiStatus(pluginId,
252 262
                IStatus.ERROR,
253 263
                childStatuses.toArray(new Status[] {}),
254
                finalMessage,
264
                t.toString(),
255 265
                t);
256 266

  
257
        errorDialog(title, source, t, ms);
267
        errorDialog(title, source, t, finalMessage, ms);
258 268
    }
259 269

  
260 270

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)