e2core icon indicating copy to clipboard operation
e2core copied to clipboard

Implement noop handler for when neither atmo, nor the coordinator can handle an fqfn

Open javorszky opened this issue 4 years ago • 1 comments

When atmo doesn't have a handler registered for the fqfn, it asks the coordinator whether it knows of anything that could handle the request.

When that says no, currently we log an error and return here: https://github.com/suborbital/atmo/blob/main/atmo/atmo.go#L105

That results in multiple questions to the same request that can't be handled be answered multiple times with the exact same "nope" message.

If instead we assigned a noop handler that would return an error message to the client:

  • either a 405 method not allowed https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405, though that's mostly for request verbs on endpoints, or
  • 404 not found https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404, because there's no defined handler on that fqfn
  • a 501 not implemented https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501

The main decision we need to make is whether to classify a request that atmo can't fulfill a user error (in which case a 404 is better), or a server issue, in which case a 501 is better

javorszky avatar Feb 08 '22 13:02 javorszky

imo, it sounds like a 404 since atmo is functioning as expected.

denopink avatar Feb 08 '22 14:02 denopink