send error response with status code 500