diff --git a/schools/src/main/java/com/lambdaschool/schools/config/SwaggerWebMVC.java b/schools/src/main/java/com/lambdaschool/schools/config/SwaggerWebMVC.java
new file mode 100644
index 00000000..4918e072
--- /dev/null
+++ b/schools/src/main/java/com/lambdaschool/schools/config/SwaggerWebMVC.java
@@ -0,0 +1,35 @@
+package com.lambdaschool.usermodel.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * The application turns off any automatic web page generate done by Spring. This is done to improve exception handling.
+ * However, we do need some web page generate done for Swagger, so we do that here.
+ */
+@Configuration
+public class SwaggerWebMVC
+ implements WebMvcConfigurer
+{
+ /**
+ * Adds the Swagger web pages to Spring.
+ * This still gives the following warning
+ *
+ * No mapping for GET /
+ * No mapping for GET /csrf
+ *
+ * All works though
+ *
+ * @param registry the place that holds the web pages for Spring
+ */
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry)
+ {
+ registry.addResourceHandler("swagger-ui.html")
+ .addResourceLocations("classpath:/META-INF/resources/");
+
+ registry.addResourceHandler("/webjars/**")
+ .addResourceLocations("classpath:/META-INF/resources/webjars/");
+ }
+}
\ No newline at end of file
diff --git a/schools/src/main/java/com/lambdaschool/schools/exceptions/CustomErrorDetails.java b/schools/src/main/java/com/lambdaschool/schools/exceptions/CustomErrorDetails.java
new file mode 100644
index 00000000..8c52e9d0
--- /dev/null
+++ b/schools/src/main/java/com/lambdaschool/schools/exceptions/CustomErrorDetails.java
@@ -0,0 +1,33 @@
+package com.lambdaschool.schools.exceptions;
+
+import com.lambdaschool.schools.services.HelperFunctions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.WebRequest;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@Component
+public class CustomErrorDetails extends DefaultErrorAttributes
+{
+ @Autowired
+ HelperFunctions helperFunctions;
+
+ @Override
+ public Map getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
+ Map errorAttributes = super.getErrorAttributes(webRequest, includeStackTrace);
+ Map errorDetails = new LinkedHashMap<>();
+
+ errorDetails.put("title", errorAttributes.get("error"));
+ errorDetails.put("status", errorAttributes.get("status"));
+ errorDetails.put("detail", errorAttributes.get("message"));
+ errorDetails.put("timestamps", errorAttributes.get("timestamp"));
+ errorDetails.put("developerMessage", "path: " + errorAttributes.get("path"));
+
+ errorDetails.put("errors", helperFunctions.getConstraintViolation(this.getError(webRequest)));
+
+ return errorDetails;
+ }
+}
diff --git a/schools/src/main/java/com/lambdaschool/schools/exceptions/ResourceNotFoundException.java b/schools/src/main/java/com/lambdaschool/schools/exceptions/ResourceNotFoundException.java
new file mode 100644
index 00000000..8f6a671c
--- /dev/null
+++ b/schools/src/main/java/com/lambdaschool/schools/exceptions/ResourceNotFoundException.java
@@ -0,0 +1,9 @@
+package com.lambdaschool.schools.exceptions;
+
+public class ResourceNotFoundException extends RuntimeException
+{
+ public ResourceNotFoundException(String message)
+ {
+ super(message);
+ }
+}
diff --git a/schools/src/main/java/com/lambdaschool/schools/handlers/RestExceptionHandler.java b/schools/src/main/java/com/lambdaschool/schools/handlers/RestExceptionHandler.java
new file mode 100644
index 00000000..5851b470
--- /dev/null
+++ b/schools/src/main/java/com/lambdaschool/schools/handlers/RestExceptionHandler.java
@@ -0,0 +1,74 @@
+package com.lambdaschool.schools.handlers;
+
+
+import com.lambdaschool.schools.exceptions.ResourceNotFoundException;
+import com.lambdaschool.schools.models.ErrorDetail;
+import com.lambdaschool.schools.services.HelperFunctions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.NoHandlerFoundException;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
+
+import java.util.Date;
+
+@Order(Ordered.HIGHEST_PRECEDENCE)
+@RestControllerAdvice
+public class RestExceptionHandler extends ResponseEntityExceptionHandler
+{
+ @Autowired
+ private HelperFunctions helperFunctions;
+
+ public RestExceptionHandler()
+ {
+ super();
+ }
+
+ @ExceptionHandler(ResourceNotFoundException.class)
+ public ResponseEntity> handleResourcesNotFoundException(ResourceNotFoundException rnfe)
+ {
+ ErrorDetail errorDetail = new ErrorDetail();
+ errorDetail.setTimestamp(new Date());
+ errorDetail.setStatus(HttpStatus.NOT_FOUND.value());
+ errorDetail.setTitle("Resource Not Found!");
+ errorDetail.setDetail(rnfe.getMessage());
+ errorDetail.setDeveloperMessage(rnfe.getClass().getName());
+ errorDetail.setErrors(helperFunctions.getConstraintViolation(rnfe));
+
+ return new ResponseEntity<>(errorDetail, HttpStatus.NOT_FOUND);
+ }
+
+ @Override
+ protected ResponseEntity