Skip to content

Unclear "Invalid digit found in string" error for invalid process lifetimes #1439

Description

@tsmbland

Process lifetimes must take integer values (i.e. whole number of years). If float values (e.g. 15.1) or negative values (e.g. -15) are provided, there should be a clear error message saying that only positive integer values are allowed. Instead, we currently get a rather cryptic "Invalid digit found in string" message. Presumably this comes from serde trying to deserialise into a u32. Perhaps instead we need to deserialise into a float, do the validation checks manually, then convert to u32 (or some other approach).

Side note, but the tests are currently only checking for the presence of an error, not the exact error message. We should fix this up as well.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Status
🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions