Skip to content

Commit

Permalink
Kast ResourceAccessException tilbake til klient (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
stigebil authored Nov 27, 2024
1 parent 836e7ca commit adfc561
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.springframework.http.HttpMethod
import org.springframework.http.ResponseEntity
import org.springframework.web.client.HttpClientErrorException
import org.springframework.web.client.HttpServerErrorException
import org.springframework.web.client.ResourceAccessException
import org.springframework.web.client.RestClientResponseException
import org.springframework.web.client.RestOperations
import org.springframework.web.client.exchange
Expand Down Expand Up @@ -93,6 +94,10 @@ abstract class AbstractRestClient(
responsFailure.increment()
secureLogger.warn("HttpClientErrorException ved kall mot uri=$uri", e)
lesRessurs(e)?.let { throw RessursException(it, e) } ?: throw e
} catch (e: ResourceAccessException) {
responsFailure.increment()
secureLogger.warn("ResourceAccessException ved kall mot uri=$uri", e)
throw e
} catch (e: Exception) {
responsFailure.increment()
secureLogger.warn("Feil ved kall mot uri=$uri", e)
Expand Down

0 comments on commit adfc561

Please sign in to comment.