Add client error response function