Skip to content

Commit

Permalink
Logger siste tegn ved illegalargumentexception
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Skodje <[email protected]>
  • Loading branch information
thburnett and ivanskodje committed Jun 25, 2024
1 parent ba8d60a commit 9150e3d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ fun PartData.payload(clearText: Boolean = false): ByteArray {
is PartData.FormItem -> if (clearText) {
return this.value.toByteArray()
} else {
Base64.getMimeDecoder().decode(this.value.trim())
try {
Base64.getMimeDecoder().decode(this.value.trim())
} catch (e: IllegalArgumentException) {
log.warn("Last characters in failing string: <${this.value.takeLast(10)}>", e)
throw e
}
}

is PartData.FileItem -> {
Expand Down

0 comments on commit 9150e3d

Please sign in to comment.