diff --git a/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java b/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java index 4653c35..eb83365 100644 --- a/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java +++ b/chatto/src/main/java/org/ros/chatto/security/TokenAuthenticationFilter.java @@ -110,7 +110,7 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter { filterChain.doFilter(request, response); } - catch (Exception e) { + catch (BadCredentialsException e) { response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); // response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());