diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 16:57:21 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 16:57:21 +1200 |
commit | 6dfee3947ef96e1092b668ecfc7c58037355ffb8 (patch) | |
tree | d29ab479106c97b6443bc9c6a439f315bafa18b0 /src/org/traccar/http/BaseServlet.java | |
parent | eb586ea7e074c87444663aa71e9da6f538429ae5 (diff) | |
download | trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.gz trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.bz2 trackermap-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.zip |
Implement position report loading
Diffstat (limited to 'src/org/traccar/http/BaseServlet.java')
-rw-r--r-- | src/org/traccar/http/BaseServlet.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/http/BaseServlet.java b/src/org/traccar/http/BaseServlet.java index 122dbe70b..be4b41631 100644 --- a/src/org/traccar/http/BaseServlet.java +++ b/src/org/traccar/http/BaseServlet.java @@ -70,7 +70,11 @@ public abstract class BaseServlet extends HttpServlet { public void sendResponse(Writer writer, Exception error) throws IOException { JsonObjectBuilder result = Json.createObjectBuilder(); result.add("success", false); - result.add("error", error.getMessage()); + if (error.getMessage() != null) { + result.add("error", error.getMessage()); + } else { + result.add("error", error.getClass().getSimpleName()); + } writer.write(result.build().toString()); } |