From 53201b46ef3ca9bdda922e90ed8e060ce8ecf98b Mon Sep 17 00:00:00 2001 From: fanatixan Date: Fri, 29 Jun 2018 14:48:22 +0200 Subject: [PATCH] custom exception with @ResponseStatus --- .../java/com/baeldung/annotations/CustomException.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 spring-mvc-java/src/main/java/com/baeldung/annotations/CustomException.java diff --git a/spring-mvc-java/src/main/java/com/baeldung/annotations/CustomException.java b/spring-mvc-java/src/main/java/com/baeldung/annotations/CustomException.java new file mode 100644 index 0000000000..4502a45301 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/annotations/CustomException.java @@ -0,0 +1,8 @@ +package com.baeldung.annotations; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(code = HttpStatus.BAD_REQUEST) +public class CustomException extends RuntimeException { +}