Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
except RequestException as e:
message = f"QPU Compiler {method} failed: "
try:
contents = response.json()
except Exception:
contents = None
if contents and contents.get("message"):
message += contents.get("message")
else:
message += "please try again or contact support."
raise UserMessageError(message) from e
return from_json(response.text)