Skip to content

[Correctness] ServiceValidator.cs — Error message says 30s-1h but actual bounds are 1s-86400s #511

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Info

File: src/Servy.Core/Helpers/ServiceValidator.cs, line 36

Description:
The validation error message is factually wrong:

return (false, "Stop Timeout must be between 30s and 1 hour.");

AppConfig.MinStopTimeout is 1 second (not 30s), and AppConfig.MaxStopTimeout is 86,400 seconds (24 hours, not 1 hour). This misleads users into thinking valid values are rejected.

Suggested fix:
Use the actual config values in the message:

return (false, $"Stop Timeout must be at least {AppConfig.MinStopTimeout} second(s).");

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions