-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preventing saving an entity of a different type Added tests for it Broke up ProjectRepository exceptions out to their own file
- Loading branch information
1 parent
63361e3
commit ebf236a
Showing
10 changed files
with
344 additions
and
120 deletions.
There are no files selected for viewing
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
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
17 changes: 17 additions & 0 deletions
17
...er/src/main/kotlin/com/darkrockstudios/apps/hammer/project/ProjectRepositoryExceptions.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.darkrockstudios.apps.hammer.project | ||
|
||
import com.darkrockstudios.apps.hammer.base.http.ApiProjectEntity | ||
|
||
class InvalidSyncIdException : Exception("Invalid sync id") | ||
class NoEntityTypeFound(val id: Int) : Exception("Could not find Type for Entity ID: $id") | ||
class EntityNotFound(val id: Int) : Exception("Entity $id not found on server") | ||
class EntityTypeConflictException( | ||
val id: Int, | ||
val existingType: ApiProjectEntity.Type, | ||
val submittedType: ApiProjectEntity.Type | ||
) : | ||
Exception( | ||
"Entity type conflict for ID: $id\n" + | ||
" Existing Type: $existingType\n" + | ||
" Submitted Type: $submittedType" | ||
) |
Oops, something went wrong.