-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from lsst-sqre/tickets/DM-42994
DM-42994: Improve reporting for LTD Keeper errors
- Loading branch information
Showing
9 changed files
with
112 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,15 +24,15 @@ jobs: | |
timeout-minutes: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected].0 | ||
uses: pre-commit/[email protected].1 | ||
|
||
test: | ||
|
||
|
@@ -46,9 +46,10 @@ jobs: | |
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run tox | ||
uses: lsst-sqre/run-tox@v1 | ||
|
@@ -66,7 +67,7 @@ jobs: | |
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
|
@@ -76,7 +77,7 @@ jobs: | |
- name: Run tox | ||
uses: lsst-sqre/run-tox@v1 | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
tox-envs: "docs" | ||
# Add docs-linkcheck when the docs and PyPI package are published | ||
# tox-envs: "docs,docs-linkcheck" | ||
|
@@ -105,14 +106,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Build and publish | ||
uses: lsst-sqre/build-and-publish-to-pypi@v2 | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
upload: false | ||
|
||
pypi: | ||
|
@@ -132,11 +133,11 @@ jobs: | |
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # full history for setuptools_scm | ||
|
||
- name: Build and publish | ||
uses: lsst-sqre/build-and-publish-to-pypi@v2 | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### New features | ||
|
||
- Improved error reporting when requests to LTD Keeper fail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
"""Exceptions related to the LTD Keeper. | ||
""" | ||
"""Exceptions related to the LTD Keeper.""" | ||
|
||
__all__ = ("KeeperError",) | ||
__all__ = ["KeeperError"] | ||
|
||
from typing import Optional | ||
|
||
from ..exceptions import ConveyorError | ||
|
||
|
||
class KeeperError(ConveyorError): | ||
"""Error raised because of issues using the LTD Keeper API.""" | ||
|
||
def __init__( | ||
self, | ||
message: str, | ||
status_code: Optional[int] = None, | ||
body: Optional[str] = None, | ||
): | ||
if status_code is not None: | ||
message = f"(LTD status code: {status_code})\n\n{message}" | ||
if body is not None: | ||
message = f"{body}\n\n{message}" | ||
super().__init__(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters