mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-12-15 06:52:31 +00:00
b7beb0971f
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [hcloud](https://togithub.com/hetznercloud/hcloud-python) ([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md)) | `1.32.0` -> `1.33.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.33.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.33.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.32.0/1.33.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.32.0/1.33.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>hetznercloud/hcloud-python (hcloud)</summary> ### [`v1.33.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1330-2023-12-19) [Compare Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.32.0...v1.33.0) ##### Features - add metrics endpoint for load balancers and servers ([#​331](https://togithub.com/hetznercloud/hcloud-python/issues/331)) ([ee3c54f](ee3c54fd1b
)) ##### Bug Fixes - fallback to error code when message is unset ([#​328](https://togithub.com/hetznercloud/hcloud-python/issues/328)) ([1c94153](1c94153d93
)) ##### Dependencies - update actions/setup-python action to v5 ([#​335](https://togithub.com/hetznercloud/hcloud-python/issues/335)) ([2ac252d](2ac252d18b
)) - update dependency sphinx-rtd-theme to v2 ([#​330](https://togithub.com/hetznercloud/hcloud-python/issues/330)) ([7cc4335](7cc4335cac
)) - update pre-commit hook psf/black-pre-commit-mirror to v23.12.0 ([#​338](https://togithub.com/hetznercloud/hcloud-python/issues/338)) ([38e4748](38e4748d3d
)) - update pre-commit hook pycqa/isort to v5.13.0 ([#​336](https://togithub.com/hetznercloud/hcloud-python/issues/336)) ([3244cfe](3244cfef2f
)) - update pre-commit hook pycqa/isort to v5.13.1 ([#​337](https://togithub.com/hetznercloud/hcloud-python/issues/337)) ([020a0ef](020a0eff6b
)) - update pre-commit hook pycqa/isort to v5.13.2 ([#​339](https://togithub.com/hetznercloud/hcloud-python/issues/339)) ([b46df8c](b46df8cbb2
)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo <ljonas@riseup.net>
17 lines
508 B
Python
17 lines
508 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
class HCloudException(Exception):
|
|
"""There was an error while using the hcloud library"""
|
|
|
|
|
|
class APIException(HCloudException):
|
|
"""There was an error while performing an API Request"""
|
|
|
|
def __init__(self, code: int | str, message: str | None, details: Any):
|
|
super().__init__(code if message is None and isinstance(code, str) else message)
|
|
self.code = code
|
|
self.message = message
|
|
self.details = details
|