|
Lines 343-353
Link Here
|
| 343 |
} |
343 |
} |
| 344 |
|
344 |
|
| 345 |
// flags to tailor error reporting |
345 |
// flags to tailor error reporting |
|
|
346 |
/** |
| 347 |
* Use this flag if you are calling openError from a none UI thread. The |
| 348 |
* flag is checked in openDialog method. |
| 349 |
*/ |
| 346 |
public static final int PERFORM_SYNC_EXEC = 1; |
350 |
public static final int PERFORM_SYNC_EXEC = 1; |
|
|
351 |
/** |
| 352 |
* Use this flag to log all TeamExceptions and its descendants. |
| 353 |
*/ |
| 347 |
public static final int LOG_TEAM_EXCEPTIONS = 2; |
354 |
public static final int LOG_TEAM_EXCEPTIONS = 2; |
| 348 |
public static final int LOG_CORE_EXCEPTIONS = 4; |
355 |
/** |
|
|
356 |
* Use this flag to log all CoreExceptions excluding TeamExceptions and its |
| 357 |
* descendants. |
| 358 |
*/ |
| 359 |
public static final int LOG_NONTEAM_CORE_EXCEPTIONS = 4; |
| 360 |
/** |
| 361 |
* Use this flag to log an exception other than CoreException (e.g. |
| 362 |
* IOException). |
| 363 |
*/ |
| 349 |
public static final int LOG_OTHER_EXCEPTIONS = 8; |
364 |
public static final int LOG_OTHER_EXCEPTIONS = 8; |
| 350 |
public static final int LOG_NONTEAM_EXCEPTIONS = LOG_CORE_EXCEPTIONS | LOG_OTHER_EXCEPTIONS; |
365 |
/** |
|
|
366 |
* Use this flag to log all CoreExceptions. |
| 367 |
*/ |
| 368 |
public static final int LOG_CORE_EXCEPTIONS = LOG_TEAM_EXCEPTIONS |
| 369 |
| LOG_NONTEAM_CORE_EXCEPTIONS; |
| 370 |
/** |
| 371 |
* Use this flag to log all exceptions different than TeamException and its |
| 372 |
* descendant. |
| 373 |
*/ |
| 374 |
public static final int LOG_NONTEAM_EXCEPTIONS = LOG_NONTEAM_CORE_EXCEPTIONS |
| 375 |
| LOG_OTHER_EXCEPTIONS; |
| 351 |
|
376 |
|
| 352 |
/** |
377 |
/** |
| 353 |
* Convenience method for showing an error dialog |
378 |
* Convenience method for showing an error dialog |
|
Lines 385-401
Link Here
|
| 385 |
// Determine the status to be displayed (and possibly logged) |
410 |
// Determine the status to be displayed (and possibly logged) |
| 386 |
IStatus status = null; |
411 |
IStatus status = null; |
| 387 |
boolean log = false; |
412 |
boolean log = false; |
| 388 |
if (exception instanceof CoreException) { |
413 |
if (exception instanceof TeamException) { |
| 389 |
status = ((CoreException)exception).getStatus(); |
|
|
| 390 |
log = ((flags & LOG_CORE_EXCEPTIONS) > 0); |
| 391 |
} else if (exception instanceof TeamException) { |
| 392 |
status = ((TeamException)exception).getStatus(); |
414 |
status = ((TeamException)exception).getStatus(); |
| 393 |
log = ((flags & LOG_TEAM_EXCEPTIONS) > 0); |
415 |
log = (flags & LOG_TEAM_EXCEPTIONS) > 0; |
|
|
416 |
} else if (exception instanceof CoreException) { |
| 417 |
status = ((CoreException)exception).getStatus(); |
| 418 |
log = (flags & LOG_NONTEAM_CORE_EXCEPTIONS) > 0; |
| 394 |
} else if (exception instanceof InterruptedException) { |
419 |
} else if (exception instanceof InterruptedException) { |
| 395 |
return new CVSStatus(IStatus.OK, CVSUIMessages.ok); |
420 |
return new CVSStatus(IStatus.OK, CVSUIMessages.ok); |
| 396 |
} else if (exception != null) { |
421 |
} else if (exception != null) { |
| 397 |
status = new CVSStatus(IStatus.ERROR, CVSUIMessages.internal, exception); |
422 |
status = new CVSStatus(IStatus.ERROR, CVSUIMessages.internal, exception); |
| 398 |
log = ((flags & LOG_OTHER_EXCEPTIONS) > 0); |
423 |
log = (flags & LOG_OTHER_EXCEPTIONS) > 0; |
| 399 |
if (title == null) title = CVSUIMessages.internal; |
424 |
if (title == null) title = CVSUIMessages.internal; |
| 400 |
} |
425 |
} |
| 401 |
|
426 |
|