Updated error to be more expressive.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
@@ -352,7 +352,7 @@ impl Calculation {
|
||||
if base == ftype {
|
||||
self.values.push(holder);
|
||||
} else {
|
||||
let err = MTTError::new(NameType::None, ErrorID::FieldInvalidType);
|
||||
let err = MTTError::new(ErrorID::FieldInvalidType);
|
||||
return Err(err);
|
||||
}
|
||||
Ok(())
|
||||
@@ -380,7 +380,7 @@ impl Calculation {
|
||||
if base == ftype {
|
||||
Ok(())
|
||||
} else {
|
||||
let err = MTTError::new(NameType::None, ErrorID::FieldInvalidType);
|
||||
let err = MTTError::new(ErrorID::FieldInvalidType);
|
||||
return Err(err);
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,7 @@ mod calculations {
|
||||
match calc.add_value("other") {
|
||||
Ok(_) => unreachable!("should have errored with wrong type"),
|
||||
Err(err) => {
|
||||
let err_id = err.error_id();
|
||||
let err_id = err.get_error_ids().back().unwrap();
|
||||
match err_id {
|
||||
ErrorID::FieldInvalidType => {}
|
||||
_ => unreachable!("got {:?}, expected wrong field type", err_id),
|
||||
@@ -605,7 +605,7 @@ mod calculations {
|
||||
calc.add_value(Uuid::nil()).unwrap();
|
||||
match calc.add_value("mismatch") {
|
||||
Ok(_) => unreachable!("should have returned an error"),
|
||||
Err(err) => match err.error_id() {
|
||||
Err(err) => match err.get_error_ids().back().unwrap() {
|
||||
ErrorID::FieldInvalidType => {}
|
||||
_ => unreachable!("got {:?}, expected wrong field type", err),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user