3 ms·
404 is not an error, it's a status code that says "What you asked for does not exist". Why are you worrying about log spam? Why are you monitoring 404s? Now you
by titusjohnson 2y ago
404 is not an error, it's a status code that says "What you asked for does not exist". Why are you worrying about log spam? Why are you monitoring 404s? Now you have an endpoint that lies, how is that better?
- ozim 2y agoNo it is not "just status code": Successful responses (200 – 299) Client error responses (400 – 499) https://developer.mozilla.org/en-US/docs/Web/HTTP/Status https://developer.mozilla.org/en-US/docs/Web/HTTP/Status I am not monitoring it per se - but all the tooling we use counts it as an error. My endpoint is not lying - request is a question "Is there an entity B linked to entity A" - hence answer is always there and it is either "true" or "false", I am not requesting "give me entity B with Id xyz", that is a different endpoint that can return 404 nor prob.
- titusjohnson 2y agoObviously I don't know your product, but that just sounds like an endpoint that exposes a join table. Any time I see status code sidestepping, it informs me that something more basic has been skipped earlier. "The monitoring is firing too often because of 404 errors, we should make this endpoint send back a 200 all the time so we stop being bothered by errors that are not errors" reads to me like curing a symptom.
- ozim 2y agoTo be more concrete we have 2 separate applications that you can use together. First app can display a link to document in second app if document is there. What we do is checking via API if document exists - show the link to open it. Only if user would try to open the link 404 would be correct. Checking if app should show the link 200 with true/false makes much more sense.