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.
27 * @param __m The message for the error.
30 public JDWPCommandException(JDWPErrorType __errorType
, String __m
)
34 this.type
= (__errorType
== null ? JDWPErrorType
.INTERNAL
:
39 * Initializes the exception.
41 * @param __errorType The error type.
42 * @param __m The message for the error.
43 * @param __c The cause.
46 public JDWPCommandException(JDWPErrorType __errorType
, String __m
,
51 this.type
= (__errorType
== null ? JDWPErrorType
.INTERNAL
:
56 * Generates an exception for an invalid class.
58 * @param __obj The context.
59 * @param __cause The cause of this exception.
60 * @return The exception.
63 public static JDWPCommandException
tossInvalidClass(Object __obj
,
66 return JDWPErrorType
.INVALID_CLASS
.toss(__obj
,
67 System
.identityHashCode(__obj
), __cause
);
71 * Generates an exception for an invalid method.
73 * @param __obj The context.
74 * @param __methodDx The method index.
75 * @param __cause The cause of this exception.
76 * @return The exception.
79 public static JDWPCommandException
tossInvalidMethod(Object __obj
,
80 int __methodDx
, Throwable __cause
)
82 return JDWPErrorType
.INVALID_METHOD_ID
.toss(__obj
, __methodDx
,
87 * Generates an exception for an invalid method.
89 * @param __obj The context.
90 * @param __fieldDx The field index.
91 * @param __cause The cause of this exception.
92 * @return The exception.
95 public static JDWPCommandException
tossInvalidField(Object __obj
,
96 int __fieldDx
, Throwable __cause
)
98 return JDWPErrorType
.INVALID_FIELD_ID
.toss(__obj
, __fieldDx
,