Browse Source

运行时异常抛出错误信息

wangmh 7 years ago
parent
commit
63ba45a59d

+ 0 - 14
sso-server/src/main/java/com/uas/sso/web/advice/ExceptionHandlerAdvice.java

@@ -27,22 +27,8 @@ public class ExceptionHandlerAdvice {
 	@ExceptionHandler(RuntimeException.class)
 	public ResponseEntity<ModelMap> handleRuntimeException(RuntimeException ex) {
 		logger.error("RuntimeException", ex);
-		HttpHeaders headers = new HttpHeaders();
-		headers.add("Content-Type", "application/json; charset=utf-8");
-		return new ResponseEntity<ModelMap>(error("出现异常"), headers, HttpStatus.OK);
-	}
-
-	/**
-	 * 允许用户看见的异常信息,直接传递给客户端
-	 *
-	 * @param ex 允许用户看见的异常信息
-	 * @return
-	 */
-	@ExceptionHandler({VisibleError.class, IllegalArgumentException.class})
-	public ResponseEntity<ModelMap> handleVisibleError(RuntimeException ex) {
 		HttpHeaders headers = new HttpHeaders();
 		headers.add("Content-Type", "application/json; charset=utf-8");
 		return new ResponseEntity<ModelMap>(error(ex.getMessage()), headers, HttpStatus.OK);
 	}
-
 }