Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Sep 8, 2020
1 parent 15b47de commit d962368
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/kotlin/tech/relaycorp/poweb/PoWebClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ public class PoWebClient internal constructor(
return try {
post("/parcels", body)
} catch (exc: ClientBindingException) {
if (exc.statusCode == 403) {
throw RejectedParcelException("The server rejected the parcel")
} else {
throw exc
}
throw if (exc.statusCode == 403)
RejectedParcelException("The server rejected the parcel")
else
exc
}
}

Expand Down

0 comments on commit d962368

Please sign in to comment.