1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +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) CDTDebugModelPresentation.25=(disabled)
CBreakpointWorkbenchAdapterFactory.0=C/C++ breakpoint CBreakpointWorkbenchAdapterFactory.0=C/C++ breakpoint
CBreakpointWorkbenchAdapterFactory.1=C/C++ watchpoint 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) * @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 { public Object handleStatus( final IStatus status, Object source ) throws CoreException {
if ( status != null && source != null && source instanceof IDebugElement ) { if ( status != null && source != null ) {
IDebugTarget target = ((IDebugElement)source).getDebugTarget(); String title = "";
final String title = target.getName(); 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() { CDebugUIPlugin.getStandardDisplay().asyncExec( new Runnable() {
public void run() { public void run() {
ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title, null, status ); ErrorDialog.openError( CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status );
} }
} ); } );
} }