Skip to content

Commit

Permalink
feat: add ParseException
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Aug 28, 2022
1 parent e83874e commit fbf3611
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ object CommandException extends Enum[CommandException] {
case object ArgIsInsufficient extends CommandException("Arg is insufficient. See /rw help")

case object CommandExecutionFailed extends CommandException("Execution has failed")

case object ArgIsNotUuid extends CommandException("Arg is not UUID")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package click.seichi.regenerateworld.presenter.shared.exception

import enumeratum.{Enum, EnumEntry}

sealed abstract class ParseException(override val description: String)
extends EnumEntry
with OriginalException

object ParseException extends Enum[ParseException] {
override val values: IndexedSeq[ParseException] = findValues

case object IsNotUuid extends ParseException("It is not UUID")

case object MustBeLong extends ParseException("It must be Long")

case object MustBeNaturalNumber extends ParseException("It must be natural number")

case object MustBeDateTimeUnit extends ParseException("It must be DateTimeUnit")

case object MustBeInterval extends ParseException("It must be Interval")
}

0 comments on commit fbf3611

Please sign in to comment.