Charger commands validation error handling improvement
| Date | Endpoint |
|---|---|
| 02-03-2026 | POST /api/chargers/{id}/sendCommand |
Summary
Improved validation and error responses when sending commands to chargers that are missing or not in a valid state. Previously, these cases could lead to internal ArgumentNullExceptions and a generic OperationFailedForUnknownReasons error.
New behavior
Instead of returning OperationFailedForUnknownReasons, the endpoint now responds more explicitly:
-
If the charger does not exist (
charger == null):
ReturnsUnknownObject(aligned with other public charger endpoints). -
If the charger is deactivated or its
deviceIdis null/empty:
ReturnsUnknownDeviceId.
Impact
- No changes to successful calls; valid chargers behave as before.
- For invalid or deactivated chargers, clients now receive clearer, more specific error codes instead of a generic failure reason.
