-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kast FunksjonellFeil i stedet for å tryne med NoSuchElementException for VilkårsResultater. #1099
The head ref may contain hidden characters: "eksisterende-vilk\u00E5rsresultat-funksjonellfeil"
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,8 +85,14 @@ fun endreVilkårResultat( | |
endretVilkårResultat = endretVilkårResultatDto, | ||
) | ||
|
||
val endretVilkårResultat = | ||
endretVilkårResultatDto.tilVilkårResultat(eksisterendeVilkårResultater.single { it.id == endretVilkårResultatDto.id }) | ||
val eksisterendeVilkårsResultat = | ||
eksisterendeVilkårResultater.singleOrNull { it.id == endretVilkårResultatDto.id } | ||
?: throw FunksjonellFeil( | ||
"Fant ikke eksisterende vilkårsresultat med id: ${endretVilkårResultatDto.id}. Mulig knyttet til problem med flere faner", | ||
"Fant ikke eksisterende vilkårsresultat med id: ${endretVilkårResultatDto.id}. Kontroller at vilkårsresultatet eksisterer ved å f.eks laste inn siden på nytt.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Litt usikker på hvor mye kjennskap SB har til domene objektet "Vilkårresultat". "Vilkårene har endret seg siden sist gang du lastet inn siden. Vennligst forsøk å laste inn siden på nytt"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mye bedre ✅ |
||
) | ||
|
||
val endretVilkårResultat = endretVilkårResultatDto.tilVilkårResultat(eksisterendeVilkårsResultat) | ||
|
||
val (vilkårResultaterSomSkalTilpasses, vilkårResultaterSomIkkeTrengerTilpassning) = | ||
eksisterendeVilkårResultater.partition { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sikkert greit med named parameters her for å se hva som er hva! :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Støttes