From 81eeba2e3264cb2151f20301bc898b814344b77f Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 30 Jun 2019 16:16:25 +0530 Subject: [PATCH] [BAEL-14274] - Fixed article code for https://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration --- .../com/baeldung/web/exception/BadRequestException.java | 8 ++++++++ .../baeldung/web/exception/ResourceNotFoundException.java | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 spring-boot-rest/src/main/java/com/baeldung/web/exception/BadRequestException.java create mode 100644 spring-boot-rest/src/main/java/com/baeldung/web/exception/ResourceNotFoundException.java diff --git a/spring-boot-rest/src/main/java/com/baeldung/web/exception/BadRequestException.java b/spring-boot-rest/src/main/java/com/baeldung/web/exception/BadRequestException.java new file mode 100644 index 0000000000..9ebf885d4b --- /dev/null +++ b/spring-boot-rest/src/main/java/com/baeldung/web/exception/BadRequestException.java @@ -0,0 +1,8 @@ +package com.baeldung.web.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(value = HttpStatus.BAD_REQUEST) +public class BadRequestException extends RuntimeException { +} diff --git a/spring-boot-rest/src/main/java/com/baeldung/web/exception/ResourceNotFoundException.java b/spring-boot-rest/src/main/java/com/baeldung/web/exception/ResourceNotFoundException.java new file mode 100644 index 0000000000..a80802eadf --- /dev/null +++ b/spring-boot-rest/src/main/java/com/baeldung/web/exception/ResourceNotFoundException.java @@ -0,0 +1,8 @@ +package com.baeldung.web.exception; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ResponseStatus(value = HttpStatus.NOT_FOUND) +public class ResourceNotFoundException extends RuntimeException { +}