Package: DbgpDebuggingEngineException

DbgpDebuggingEngineException

nameinstructionbranchcomplexitylinemethod
DbgpDebuggingEngineException(int)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
DbgpDebuggingEngineException(int, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
DbgpDebuggingEngineException(int, String, Throwable)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
DbgpDebuggingEngineException(int, Throwable)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getCode()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMessage()
M: 27 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * org.overture.ide.debug
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.ide.debug.core.dbgp.exceptions;
23:
24: import org.overture.ide.debug.utils.communication.DBGPErrorType;
25: import org.overture.interpreter.debug.DBGPException;
26:
27: public class DbgpDebuggingEngineException extends DbgpException
28: {
29:         private static final long serialVersionUID = 1L;
30:
31:         /* Command parsing errors */
32:         public static final int NO_ERROR = 0;
33:
34:         public static final int PASSE_ERROR_IN_COMMAND = 1;
35:
36:         public static final int DUPLICATE_ARGUMENTS_IN_COMMAND = 2;
37:
38:         // missing a required option
39:         public static final int INVALID_OPTIONS = 3;
40:
41:         public static final int UNIMPLEMENTED_COMMAND = 4;
42:
43:         // Is used for async commands. For instance
44:         // if the engine is in state "run" than only "break" and "status"
45:         // are available
46:         public static final int COMMAND_NOT_AVAILABLE = 5;
47:
48:         /* File related errors */
49:
50:         // as a reply to a "source" command if the requested source file can't be
51:         // opened
52:         public static final int FILE_CAN_NOT_OPEN_FILE = 100;
53:
54:         // stream redirect failed
55:         public static final int STREAM_REDIRECT_FAILED = 101;
56:
57:         /* Breakpoint, or code flow errors */
58:
59:         // for some reason the breakpoint could not be set due to problems
60:         // registering it
61:         public static final int BREAKPOINT_COULD_NOT_BE_SET = 200;
62:
63:         // for example I don't support 'watch' yet and thus return this error
64:         public static final int BREAKPOINT_TYPE_NOT_SUPPORTED = 201;
65:
66:         // the IDE tried to set a breakpoint on a line that does not exist in the
67:         // file (ie "line 0" or lines past the end of the file
68:         public static final int INVALID_PREAKPOINT = 202;
69:
70:         // the IDE tried to set a breakpoint on a line which does not have any
71:         // executable code. The
72:         // debugger engine is NOT required to return this type if it
73:         // is impossible to determine if there is code on a given
74:         // location. (For example, in the PHP debugger backend this
75:         // will only be returned in some special cases where the current
76:         // scope falls into the scope of the breakpoint to be set
77:         public static final int NO_CODE_ON_BREAKPOINT_LINE = 203;
78:
79:         // using an unsupported breakpoint state was attempted
80:         public static final int INVALID_BREAKPOINT_STATE = 204;
81:
82:         // used in breakpoint_get etc. to show that there is no breakpoint with the
83:         // given ID
84:         public static final int NO_SUCH_BREAKPOINT = 205;
85:
86:         // use from eval() (or perhaps property_get for a full name get
87:         public static final int ERROR_EVALUATING_CODE = 206;
88:
89:         // the expression used for a non-eval() was invalid
90:         public static final int IVALID_EXPRESSION = 207;
91:
92:         /* Data errors */
93:
94:         // when the requested property to get did
95:         // not exist, this is NOT used for an existing but uninitialized
96:         // property, which just gets the type "uninitialised" (See:
97:         // PreferredTypeNames)
98:         public static final int CAN_NOT_GET_PROPERTY = 300;
99:
100:         // the -d stack depth parameter did not exist (ie, there were less stack
101:         // elements than the number requested) or the parameter was < 0
102:         public static final int STACH_DEPTH_INVALID = 301;
103:
104:         // an non existing context was requested
105:         public static final int CONTEXT_INVALID = 302;
106:
107:         /* Protocol errors */
108:         public static final int ENCODING_NOT_SUPPROTED = 900;
109:
110:         public static final int INTERNAL_EXCEPTION = 998;
111:
112:         public static final int UNKNOWN_ERROR = 999;
113:
114:         private final int code;
115:
116:         public DbgpDebuggingEngineException(int code)
117:         {
118:                 this.code = code;
119:         }
120:
121:         public DbgpDebuggingEngineException(int code, String message)
122:         {
123:                 super(message);
124:                 // super(NLS.bind("dbgpDebuggingEngineException", new Integer(code),
125:                 // message));
126:                 this.code = code;
127:         }
128:
129:         public DbgpDebuggingEngineException(int code, Throwable cause)
130:         {
131:                 super(cause);
132:                 this.code = code;
133:         }
134:
135:         public DbgpDebuggingEngineException(int code, String message,
136:                         Throwable cause)
137:         {
138:                 // super(NLS.bind("dbgpDebuggingEngineException2", message, new Integer(
139:                 // code)), cause);
140:                 super(message, cause);
141:                 this.code = code;
142:         }
143:
144:         public int getCode()
145:         {
146:                 return code;
147:         }
148:
149:         @Override
150:         public String getMessage()
151:         {
152:                 String protocolErrorMessage = new Integer(getCode()).toString();
153:                 try
154:                 {
155:                         protocolErrorMessage = DBGPErrorType.lookup(getCode()).toString();
156:                 } catch (DBGPException e)
157:                 {
158:                         //
159:                 }
160:                 return protocolErrorMessage + "\nDetailed Message: "
161:                                 + super.getMessage();
162:         }
163: }