Unclear "Invalid digit found in string" error for invalid process lifetimes
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Locate the process-lifetime deserialization and its existing tests, then run those tests to reproduce the cryptic error for float and negative values. Make invalid values produce a clear message that only positive integers are allowed, and update the tests to assert the exact message.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 8
- Forks
- 5
- Avg merge
- 11h 31m
- Merged PRs (30d)
- 33
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EnergySystemsModellingLab/MUSE2
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
EnergySystemsModellingLab/MUSE2#1367 · 1 comment ·
Maintainers usually reply within 1 day
-
Remove the `ironing out iteration 0` prefix from debug files when the ironing out loop is turned offOpenmuse xiii question
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
EnergySystemsModellingLab/MUSE2#1221 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
EnergySystemsModellingLab/MUSE2#1554 ·
Maintainers usually reply within 1 day
-
Unnecessary capacity investmentPossibly taken @tsmbland claimed this 17 days ago. Openbug
EnergySystemsModellingLab/MUSE2#1541 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
EnergySystemsModellingLab/MUSE2#1526 ·
Maintainers usually reply within 1 day
All issues in EnergySystemsModellingLab/MUSE2
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
trailofbits/dylint#2107 ·
Maintainers usually reply within 1 day
-
area:cli bug good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
arrays_zip with two same-named inputs fails with "ArrowArray struct has 2 children (expected 1)"Openbug requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datafusion-comet#6251 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug false-positive harper-core linting
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Automattic/harper#4471 ·
Maintainers usually reply within 1 day