▲ | mtlynch 2 days ago | |||||||||||||||||||||||||||||||
>The application layer should not inject error codes into the transport layer which is what HTTP is in this case. I don't follow. What's the boundary between transport layer and application layer in a Go web app? The Go web app is responsible for specifying both the HTTP status code and the response body. What's the purpose of different HTTP 4xx errors if they're not supposed to come from the application? >Do you also think that Apache/Nginx should be injecting codes into IP packets? No, because Apache/Nginx is not responsible for populating IP datagrams, whereas Go web apps are responsible for generating the entire HTTP response. >If your application injects codes into the HTTP layer, how on earth does the client know whether the error originated at the application or at the reverse proxy/webserver? It can't. What design do you have in mind where a client gets a HTTP 404 and can distinguish between the web server and the application server? Are you saying a "not found" at the application layer should return HTTP 200 and the client has to check the HTTP body for the real error code? | ||||||||||||||||||||||||||||||||
▲ | lelanthran 2 days ago | parent [-] | |||||||||||||||||||||||||||||||
> I don't follow. What's the boundary between transport layer and application layer in a Go web app? Just because it's the same app preparing both the transport and the application, you think that it's the same layer of comms? > Are you saying a "not found" at the application layer should return HTTP 200 and the client has to check the HTTP body for the real error code? The "not found" is not an application level error, even if, in your backend, you mixed them all up into the same function. | ||||||||||||||||||||||||||||||||
|