typed error responses