From 05e9a81d25a6f4d9fe14a676579a4e9a96b7d04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Tue, 1 Aug 2006 13:51:01 +0000 Subject: [PATCH] Propagate errors from VariableCollection indexer by exception git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1640 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/DebugeeInterpreterContext.cs | 10 ++++++---- .../Project/Src/Variables/VariableCollection.cs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Src/DebugeeInterpreterContext.cs b/src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Src/DebugeeInterpreterContext.cs index c8db2153e9..2b1ef47929 100644 --- a/src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Src/DebugeeInterpreterContext.cs +++ b/src/AddIns/Misc/Debugger/Debugger.BooInterpreter/Project/Src/DebugeeInterpreterContext.cs @@ -127,18 +127,20 @@ namespace Debugger void BeforeGetValue(string name) { // PrintLine("BeforeGetValue: " + name); - Variable localVar = debugger.LocalVariables[name]; - if (localVar != null) { + try { + Variable localVar = debugger.LocalVariables[name]; PrintLine("Warning: 'Getting of local variables not implemented'"); + } catch (DebuggerException) { } } void AfterSetValue(string name) { //PrintLine("AfterSetValue: " + name); - Variable localVar = debugger.LocalVariables[name]; - if (localVar != null) { + try { + Variable localVar = debugger.LocalVariables[name]; PrintLine("Warning: 'Setting of local variables not implemented'"); + } catch (DebuggerException) { } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs index 589ca77449..5da9d6e005 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs @@ -102,7 +102,7 @@ namespace Debugger if (v.Name == variableName) return v; } } - return null; + throw new DebuggerException("Variable \"" + variableName + "\" is not in collection"); } }