Skip to content

Commit

Permalink
throw HttpServerErrorException for proper response
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Mar 4, 2021
1 parent f4ef64b commit fcac012
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.RestClientResponseException;
import org.springframework.web.client.RestTemplate;
import org.w3c.dom.DOMException;
Expand Down Expand Up @@ -489,7 +490,7 @@ private String okapiLogin() {
return token;
} else {
logger.error("Failed to login {}: {}", response.getStatusCodeValue(), response.getBody());
throw new RuntimeException("Okapi login failed!");
throw new HttpServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR, "Catalog service failed to login into Okapi!");
}
}

Expand Down

0 comments on commit fcac012

Please sign in to comment.