A 500 means a server error, so I would expect that something fatal happened on the server-side. A wrong post id is a user error, I would expect a 4xx status code in that case, e.g. 400 Bad Request, or 403 Forbidden
In any case 5xx or 4xx, axios will pass the error response to the rejection callback where you can handle it. If you use global interceptors, you can define a common error handling behaviour across all axios requests