Project

General

Profile

« Previous | Next » 

Revision 65e61086

Added by Cherian Mathew over 8 years ago

#5209 Beautify error messages related to connection / access to remote server

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
31 31
    public final static String UNEXPECTED_ERROR_MESSAGE = "This is an unexpected error.";
32 32
    public final static String CONTACT_MESSAGE = System.getProperty("line.separator") +  "Please contact EDIT Support (EditSupport@bgbm.org) with the error trace below (click on the 'Details' button).";
33 33
    public final static String DEFAULT_MESSAGE = "Error thrown but no associated message";
34
    public final static String CONNECTION_FAILURE_MESSAGE = "The connection to the remote server has been broken";
35
    public final static String REMOTE_ACCESS_FAILURE_MESSAGE = "Problem accessing remote server";
34 36

  
35 37
    /**
36 38
     * Gets the Log4J logger for a given class
......
253 255
            final Throwable t,
254 256
            final List<String> contextInfo,
255 257
            final String message,
256
            final MultiStatus status) {
258
            final MultiStatus status,
259
            final boolean showReason) {
257 260

  
258 261
        Display.getDefault().asyncExec(new Runnable() {
259 262

  
260 263
            @Override
261 264
            public void run() {
262 265
                String stackTraceWithContext = getStackTraceAndContextInfo(t, contextInfo);
263
                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext);
266
                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext, showReason);
264 267
                ced.open();
265 268
                Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
266 269

  
......
275 278
        });
276 279
    }
277 280

  
281
    public static void errorDialog(final String title,
282
            final Object source,
283
            final String message,
284
            final String pluginId,
285
            final Throwable t,
286
            boolean addContactMesg) {
287
        errorDialog(title, source, message, pluginId, t, addContactMesg, true);
288

  
289
    }
278 290
    /**
279 291
     * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
280 292
     *
......
289 301
            final String message,
290 302
            final String pluginId,
291 303
            final Throwable t,
292
            boolean addContactMesg) {
304
            boolean addContactMesg,
305
            boolean showReason) {
293 306

  
294 307
        Throwable throwable = t;
295 308
        StringBuffer sbStackTrace = new StringBuffer();
......
356 369
                throwable.toString(),
357 370
                throwable);
358 371

  
359
        errorDialog(title, source, throwable, contextInfo, finalMessage, ms);
372
        errorDialog(title, source, throwable, contextInfo, finalMessage, ms, showReason);
360 373
    }
361 374

  
362 375
    /**

Also available in: Unified diff