vapor-ware / synse-server

An HTTP API for monitoring and controlling physical and virtual devices
https://synse.readthedocs.io/en/latest/server/intro/
GNU General Public License v3.0
39 stars 11 forks source link

consider better error message when device not found #413

Open edaniszewski opened 3 years ago

edaniszewski commented 3 years ago

from a recent script:

Running Synse query:
  method: POST
  url:    localhost:5000/v3/write/wait/d7604ac1-3444-5fe0-bada-e8b9f11a411b
  data:   {"action": "set", "data": "4"}

{
  "http_code": 404,
  "description": "resource not found",
  "timestamp": "2021-01-12T12:45:10Z",
  "context": "plugin not found for device d7604ac1-3444-5fe0-bada-e8b9f11a411b"
}

The error message says that the plugin is not found for device because its looking up a plugin to route the request to, so it sorta makes sense to someone familiar with the internals of synse, but its maybe a better error message to say that the device was not found, and maybe add in extra context about how theres an off chance that it could be due to plugin cache invalidation stuff.