Skip to content

Commit 2859853

Browse files
committed
Minor exception-handling improvement
1 parent 97d4e6b commit 2859853

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/ktalex/dal/client/BaseClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ abstract class BaseClient : AutoCloseable {
8585

8686
HttpStatusCode.Forbidden -> {
8787
val error: ErrorResponse = response.body()
88-
error.message?.let { throw OpenAlexException(it) }
88+
throw OpenAlexException(error.message ?: "Access forbidden by OpenAlex API")
8989
}
9090

9191
else -> {

0 commit comments

Comments
 (0)