-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(oppijanumero): throw OppijaNotFoundException, when oppija is not…
… found
- Loading branch information
1 parent
2ce38bc
commit 7532815
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
18 changes: 16 additions & 2 deletions
18
server/src/main/kotlin/fi/oph/kitu/oppijanumero/OppijanumeroException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
package fi.oph.kitu.oppijanumero | ||
|
||
class OppijanumeroException( | ||
open class OppijanumeroException( | ||
val oppija: Oppija, | ||
message: String, | ||
val oppijanumeroServiceError: OppijanumeroServiceError? = null, | ||
cause: Throwable? = null, | ||
) : Throwable(message, cause) | ||
) : Throwable(message, cause) { | ||
class OppijaNotFoundException( | ||
oppija: Oppija, | ||
message: String = "Oppija not found from oppijanumero-service", | ||
oppijanumeroServiceError: OppijanumeroServiceError? = null, | ||
cause: Throwable? = null, | ||
) : OppijanumeroException(oppija, message, oppijanumeroServiceError, cause) | ||
|
||
class OppijaNotIdentifiedException( | ||
oppija: Oppija, | ||
message: String = "Oppija with oid ${oppija.henkilo_oid} is not identified in oppijanumero-service", | ||
oppijanumeroServiceError: OppijanumeroServiceError? = null, | ||
cause: Throwable? = null, | ||
) : OppijanumeroException(oppija, message, oppijanumeroServiceError, cause) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters