From 7387155d9d9fdaefb260e94b1094fa5ed285fdb3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 22 Sep 2015 11:34:40 +1200 Subject: Show more detailed error messages --- src/org/traccar/web/BaseServlet.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/org/traccar/web') diff --git a/src/org/traccar/web/BaseServlet.java b/src/org/traccar/web/BaseServlet.java index b7df841ca..972a1b8e7 100644 --- a/src/org/traccar/web/BaseServlet.java +++ b/src/org/traccar/web/BaseServlet.java @@ -15,6 +15,8 @@ */ package org.traccar.web; +import org.traccar.helper.Log; + import java.io.IOException; import java.io.Writer; import java.security.AccessControlException; @@ -57,12 +59,6 @@ public abstract class BaseServlet extends HttpServlet { return userId; } - public void securityCheck(boolean check) throws SecurityException { - if (!check) { - throw new SecurityException("Access denied"); - } - } - public void sendResponse(Writer writer, boolean success) throws IOException { JsonObjectBuilder result = Json.createObjectBuilder(); result.add("success", success); @@ -79,11 +75,7 @@ public abstract class BaseServlet extends HttpServlet { public void sendResponse(Writer writer, Exception error) throws IOException { JsonObjectBuilder result = Json.createObjectBuilder(); result.add("success", false); - if (error.getMessage() != null) { - result.add("error", error.getMessage()); - } else { - result.add("error", error.getClass().getSimpleName()); - } + result.add("error", Log.exceptionStack(error)); writer.write(result.build().toString()); } -- cgit v1.2.3