From 0acac626786215578f9077e28ccd76ac68cae0f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 2 May 2014 12:51:24 -0400 Subject: [PATCH] [Mono.Debugger.Soft] Make the ObjectMirror.GetValues() exception a bit more useful --- .../Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs index 8a060a2df93..f3eedccaf5b 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs @@ -74,9 +74,11 @@ namespace Mono.Debugger.Soft try { return vm.DecodeValues (vm.conn.Object_GetValues (id, ids)); } catch (CommandException ex) { - if (ex.ErrorCode == ErrorCode.INVALID_FIELDID) + if (ex.ErrorCode == ErrorCode.INVALID_FIELDID) { + if (fields.Count == 1) + throw new ArgumentException (string.Format ("The field '{0}' is not valid for this type.", fields[0].Name)); throw new ArgumentException ("One of the fields is not valid for this type.", "fields"); - else + } else throw; } } -- 2.25.1