Skip to content

[Correctness] ServiceManager.cs — ArgumentException passes field name as message instead of paramName #581

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Warning

File: src/Servy.Core/Services/ServiceManager.cs
Lines: 309–314

Description:
throw new ArgumentException(nameof(options.ServiceName)) passes nameof(options.ServiceName) as the message parameter, not the paramName parameter. The exception displays "ServiceName" as the error description rather than a meaningful message.

Suggested fix:
Use throw new ArgumentException("Value is required.", nameof(options.ServiceName));

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions