@@ -0,0 +1,890 @@
+package org.slc.sli.api.representation;%0A%0Aimport javax.ws.rs.core.Response;%0Aimport javax.ws.rs.core.Response.Status;%0Aimport javax.ws.rs.ext.ExceptionMapper;%0Aimport javax.ws.rs.ext.Provider;%0A%0Aimport org.springframework.data.mongodb.UncategorizedMongoDbException;%0Aimport org.springframework.stereotype.Component;%0A%0A/**%0A * Handle connection issues to mongo%0A *%0A * @author nbrown%0A *%0A */%0A@Provider%0A@Component%0Apublic class UncategorizedMongoExceptionHandler implements ExceptionMapper%3CUncategorizedMongoDbException%3E %7B%0A%0A    @Override%0A    public Response toResponse(UncategorizedMongoDbException exception) %7B%0A        Status errorStatus = Status.SERVICE_UNAVAILABLE;%0A        return Response%0A                .status(errorStatus)%0A                .entity(new ErrorResponse(errorStatus.getStatusCode(), errorStatus.getReasonPhrase(),%0A                        %22Could not access database%22)).build();%0A    %7D%0A%0A%7D%0A

handle lack of connections to mongo more gracefully than a 500 response Instead use 503, Service Unavailable response