Skip to content

Commit

Permalink
Mer vanlig logging i K9SakServiceSystemClient (#2778)
Browse files Browse the repository at this point in the history
* Mer vanlig logging i K9SakServiceSystemClient

* Kast exception
  • Loading branch information
tendestad authored Dec 6, 2024
1 parent fe17b1a commit 6f07332
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,20 @@ open class K9SakServiceSystemClient constructor(
success
},
{ error ->
log.error("Error response = '${error.response.body().asString("text/plain")}' fra '${request.url}'")
log.error(error.toString())
log.error("Error response = '${begrensLengde(error.response.body().asString("text/plain"), 1000)}' fra '${request.url}'", error.exception)
throw RuntimeException("Kunne ikke gjøre refresh-kall til k9sak", error)
}
)
}
}

private fun begrensLengde(input : String, maxLengde : Int): String {
return if (input.length > maxLengde) {
input.substring(0, maxLengde)
} else {
input
}
}


}

0 comments on commit 6f07332

Please sign in to comment.