Let's assume that a OP have an unhandled exception that returns to RP a stupid HTML page (error 40x, 50x).
We should take this into account
oidcrp/util.py", line 555, in load_registration_response
raise OidcServiceError(response.to_json())
AttributeError: 'dict' object has no attribute 'to_json'