Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#1,439 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
backend

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

bug

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EnergySystemsModellingLab/MUSE2

All issues in EnergySystemsModellingLab/MUSE2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.