diff --git a/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/CommandException.scala b/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/CommandException.scala index 84ef398..5ccf1af 100644 --- a/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/CommandException.scala +++ b/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/CommandException.scala @@ -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") } diff --git a/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/ParseException.scala b/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/ParseException.scala new file mode 100644 index 0000000..aab2017 --- /dev/null +++ b/src/main/scala/click/seichi/regenerateworld/presenter/shared/exception/ParseException.scala @@ -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") +}