Skip to content

Commit 487338d

Browse files
committed
Handle exceptions in ArrayValueReference.Value getter to be properly shown in watch view
(cherry picked from commit abcd933)
1 parent 4e0e54e commit 487338d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Mono.Debugging/Mono.Debugging.Evaluation/ArrayValueReference.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ public ArrayValueReference (EvaluationContext ctx, object arr, int[] indices) :
4444

4545
public override object Value {
4646
get {
47-
return adaptor.GetElement (indices);
47+
try {
48+
return adaptor.GetElement (indices);
49+
} catch (Exception e) {
50+
throw new EvaluatorException (string.Format ("Failed to get array element: {0}", e.Message), e);
51+
}
4852
}
4953
set {
5054
adaptor.SetElement (indices, value);

Mono.Debugging/Mono.Debugging.Evaluation/ExpressionEvaluator.cs

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ protected EvaluatorException (SerializationInfo info, StreamingContext context)
208208
public EvaluatorException (string msg, params object[] args): base (string.Format(msg, args))
209209
{
210210
}
211+
212+
public EvaluatorException (string message, Exception innerException) : base (message, innerException)
213+
{
214+
}
211215
}
212216

213217
[Serializable]

0 commit comments

Comments
 (0)