completed most of 05 ticket v2
This commit is contained in:
@@ -4,6 +4,6 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
thiserror = "*"
|
||||
[dev-dependencies]
|
||||
common = { path = "../../../helpers/common" }
|
||||
|
||||
@@ -3,10 +3,17 @@
|
||||
// a `String` field into each variant.
|
||||
// You'll also have to add `thiserror` as a dependency in the `Cargo.toml` file.
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
enum TicketNewError {
|
||||
#[error("Title cannot be empty")]
|
||||
TitleCannotBeEmpty,
|
||||
#[error("Title cannot be longer than 50 bytes")]
|
||||
TitleTooLong,
|
||||
#[error("Description cannot be empty")]
|
||||
DescriptionCannotBeEmpty,
|
||||
#[error("Description cannot be longer than 500 bytes")]
|
||||
DescriptionTooLong,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user