1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Fixed 193198. If an error was encountered by an action delegate, it would be eaten.

This commit is contained in:
John Cortell 2007-06-18 20:53:34 +00:00
parent 94652e017d
commit c1eac4b95e
2 changed files with 14 additions and 4 deletions

View file

@ -39,3 +39,4 @@ CDTDebugModelPresentation.24=-Infinity
CDTDebugModelPresentation.25=(disabled)
CBreakpointWorkbenchAdapterFactory.0=C/C++ breakpoint
CBreakpointWorkbenchAdapterFactory.1=C/C++ watchpoint
ErrorStatusHandler.1=Error

View file

@ -27,13 +27,22 @@ public class ErrorStatusHandler implements IStatusHandler {
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
public Object handleStatus( final IStatus status, Object source ) throws CoreException {
if ( status != null && source != null && source instanceof IDebugElement ) {
IDebugTarget target = ((IDebugElement)source).getDebugTarget();
final String title = target.getName();
if ( status != null && source != null ) {
String title = "";
if (source instanceof IDebugElement) {
IDebugTarget target = ((IDebugElement)source).getDebugTarget();
title = target.getName();
}
else {
// Source is sometimes an action delegate instance. Can't gather
// anything useful from it. Use a generic title
title = CDebugUIMessages.getString("ErrorStatusHandler.1");
}
final String title_f = title;
CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() {
public void run() {
ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status );
ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status );
}
} );
}