Skip to content

Commit dc7f9b0

Browse files
committed
Catch 407 protocol exception
1 parent 017803a commit dc7f9b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/user/ServiceUserRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.fasterxml.jackson.core.JsonProcessingException;
2424
import com.fasterxml.jackson.databind.ObjectReader;
2525
import java.io.IOException;
26+
import java.net.ProtocolException;
2627
import java.net.URL;
2728
import java.time.Duration;
2829
import java.time.Instant;
@@ -242,6 +243,8 @@ private <T> T makeRequest(Request request, ObjectReader reader) throws IOExcepti
242243
logger.error("Failed to parse JSON: {}\n{}", ex, bodyString);
243244
throw ex;
244245
}
246+
} catch (ProtocolException ex) {
247+
throw new NotAuthorizedException("Refresh token cannot be retrieved for unauthorized user");
245248
}
246249
}
247250
}

0 commit comments

Comments
 (0)