[Mono.Debugger.Soft] More specific exception when not suspended
authorMichael Hutchinson <m.j.hutchinson@gmail.com>
Fri, 28 Jun 2013 22:20:54 +0000 (18:20 -0400)
committerMichael Hutchinson <m.j.hutchinson@gmail.com>
Fri, 28 Jun 2013 22:20:54 +0000 (18:20 -0400)
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs

index d6a2a7896fc2a25457512ef2defa4ca7b78f04c5..b77458b44110eeee8ce8ee64e36dcf4b2d5011f3 100644 (file)
@@ -124,7 +124,7 @@ namespace Mono.Debugger.Soft
                                conn.VM_Resume ();
                        } catch (CommandException ex) {
                                if (ex.ErrorCode == ErrorCode.NOT_SUSPENDED)
-                                       throw new InvalidOperationException ("The vm is not suspended.");
+                                       throw new VMNotSuspendedException ();
                                else
                                        throw;
                        }
@@ -290,7 +290,7 @@ namespace Mono.Debugger.Soft
                        case ErrorCode.INVALID_FRAMEID:
                                throw new InvalidStackFrameException ();
                        case ErrorCode.NOT_SUSPENDED:
-                               throw new InvalidOperationException ("The vm is not suspended.");
+                               throw new VMNotSuspendedException ();
                        case ErrorCode.NOT_IMPLEMENTED:
                                throw new NotSupportedException ("This request is not supported by the protocol version implemented by the debuggee.");
                        case ErrorCode.ABSENT_INFORMATION:
@@ -691,4 +691,11 @@ namespace Mono.Debugger.Soft
                        get; set;
                }
        }
+
+       public class VMNotSuspendedException : InvalidOperationException
+       {
+               public VMNotSuspendedException () : base ("The vm is not suspended.")
+               {
+               }
+       }
 }