File tree Expand file tree Collapse file tree
src/main/java/com/imsweb/seerapi/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44package com .imsweb .seerapi .client ;
55
66import java .io .IOException ;
7+ import java .util .Objects ;
8+
9+ import org .jetbrains .annotations .NotNull ;
710
811import com .fasterxml .jackson .databind .ObjectMapper ;
912
1518 */
1619public class ErrorInterceptor implements Interceptor {
1720
21+ @ NotNull
1822 @ Override
1923 public Response intercept (Chain chain ) throws IOException {
2024 Response response = chain .proceed (chain .request ());
@@ -24,7 +28,7 @@ public Response intercept(Chain chain) throws IOException {
2428 ErrorResponse error = null ;
2529 if (response .body () != null ) {
2630 try {
27- error = new ObjectMapper ().readValue (response .body ().byteStream (), ErrorResponse .class );
31+ error = new ObjectMapper ().readValue (Objects . requireNonNull ( response .body () ).byteStream (), ErrorResponse .class );
2832 }
2933 catch (IOException e ) {
3034 // sometimes the error message is not right format (like for 404 errors)
You can’t perform that action at this time.
0 commit comments