Update error function to use the Response object multi-format capabilities