What HTTP code is used for a system error?

I am creating a RESTful API to control some hardware. Part of the API receives information from the serial (RS-232) interface. It may crash for a while for some reason (disconnect, break the device, etc.).

What HTTP error code should I use? I thought in the 5xx range since the query is correct, but I cannot find a suitable one.

+3


source to share


1 answer


500 seems to be the most general or appropriate. from Wikipedia:

5xx Server Error The server was unable to fulfill an explicitly valid request.

and



500 Internal Server Error General error message specified when an unexpected condition occurred and no more appropriate message.

Clients do not care why the server encountered errors while processing the request (system error), they only have to care that the request failed and this is a server error.

+3


source







All Articles