more logging to figure out problems with gson

This commit is contained in:
Alex Huang 2011-07-11 14:17:12 -07:00
parent 93c55c2823
commit b9d4d65714
2 changed files with 12 additions and 3 deletions

View File

@ -66,6 +66,10 @@
<priority value="DEBUG"/>
</category>
<category name="com.cloud.utils.nio">
<priority value="INFO"/>
</category>
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
<category name="org.apache">
<priority value="INFO"/>

View File

@ -221,7 +221,12 @@ public class Request {
public Command[] getCommands() {
if (_cmds == null) {
_cmds = s_gson.fromJson(_content, Command[].class);
try {
_cmds = s_gson.fromJson(_content, Command[].class);
} catch (RuntimeException e) {
s_logger.error("Caught problem with " + _content, e);
throw e;
}
}
return _cmds;
}
@ -313,9 +318,9 @@ public class Request {
if (_cmds == null) {
try {
_cmds = s_gson.fromJson(_content, this instanceof Response ? Answer[].class : Command[].class);
} catch (Exception e) {
} catch (RuntimeException e) {
s_logger.error("Unable to convert to json: " + _content);
return null;
throw e;
}
}
try {