1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.jdwp
;
13 * This is thrown when there is an error parsing and executing a packet.
17 public class JDWPCommandException
20 /** The type of error this is. */
21 public final JDWPErrorType type
;
24 * Initializes the exception.
26 * @param __errorType The error type.
29 public JDWPCommandException(JDWPErrorType __errorType
)
31 this.type
= (__errorType
== null ? JDWPErrorType
.INTERNAL
:
36 * Initializes the exception.
38 * @param __errorType The error type.
39 * @param __m The message for the error.
42 public JDWPCommandException(JDWPErrorType __errorType
, String __m
)
46 this.type
= (__errorType
== null ? JDWPErrorType
.INTERNAL
:
51 * Initializes the exception.
53 * @param __errorType The error type.
54 * @param __m The message for the error.
55 * @param __c The cause.
58 public JDWPCommandException(JDWPErrorType __errorType
, String __m
,
63 this.type
= (__errorType
== null ? JDWPErrorType
.INTERNAL
:
68 * Generates an exception for an invalid class.
70 * @param __obj The context.
71 * @param __cause The cause of this exception.
72 * @return The exception.
75 public static JDWPCommandException
tossInvalidClass(Object __obj
,
78 return JDWPErrorType
.INVALID_CLASS
.toss(__obj
,
79 System
.identityHashCode(__obj
), __cause
);
83 * Generates an exception for an invalid method.
85 * @param __obj The context.
86 * @param __methodDx The method index.
87 * @param __cause The cause of this exception.
88 * @return The exception.
91 public static JDWPCommandException
tossInvalidMethod(Object __obj
,
92 int __methodDx
, Throwable __cause
)
94 return JDWPErrorType
.INVALID_METHOD_ID
.toss(__obj
, __methodDx
,
99 * Generates an exception for an invalid method.
101 * @param __obj The context.
102 * @param __fieldDx The field index.
103 * @param __cause The cause of this exception.
104 * @return The exception.
107 public static JDWPCommandException
tossInvalidField(Object __obj
,
108 int __fieldDx
, Throwable __cause
)
110 return JDWPErrorType
.INVALID_FIELD_ID
.toss(__obj
, __fieldDx
,