Skip to content

Commit

Permalink
Skriv DuplikatMeldingFeil til aktivitetskort-feil-topic
Browse files Browse the repository at this point in the history
  • Loading branch information
holymaloney committed Dec 19, 2024
1 parent 853de96 commit cf39b60
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import java.util.*

@Service
@ToString(of = ["aktivitetskortService"])
open class AktivitetskortConsumer (
class AktivitetskortConsumer (
private val aktivitetskortService: AktivitetskortService,
private val kasseringsService: KasseringsService,
private val feilProducer: AktivitetsKortFeilProducer,
Expand Down Expand Up @@ -62,12 +62,11 @@ open class AktivitetskortConsumer (
bestilling.getAktivitetskortId()
)
behandleBestilling(bestilling)
} catch (e: DuplikatMeldingFeil) {
ConsumeStatus.OK
} catch (e: AktivitetsKortFunksjonellException) {
val logMedPassendeNivå: (String, String?, Long, Int) -> Unit = when(e) {
is ManglerOppfolgingsperiodeFeil -> log::warn
is UlovligEndringFeil -> log::warn
is DuplikatMeldingFeil -> log::warn
else -> log::error
}
logMedPassendeNivå(
Expand Down Expand Up @@ -152,7 +151,7 @@ data class TraceFields(
val source: MessageSource
) {
constructor(messageId: UUID, source: String?)
: this(messageId, MessageSource.values().find { it.name == source } ?: MessageSource.UNKNOWN)
: this(messageId, MessageSource.entries.find { it.name == source } ?: MessageSource.UNKNOWN)
}

fun Long.toLocalDateTimeDefaultZone() = LocalDateTime.ofInstant(Instant.ofEpochMilli(this), ZoneId.systemDefault())

0 comments on commit cf39b60

Please sign in to comment.