Skip to content

Commit

Permalink
add adapters exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
flavien-hugs committed May 30, 2024
1 parent ed13f00 commit 63c8545
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
include = src/*
omit = tests/*
8 changes: 6 additions & 2 deletions .github/workflows/pipeline-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
- '3.x'

runs-on: ubuntu-latest
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true

defaults:
run:
working-directory: 'src/'
Expand All @@ -79,5 +83,5 @@ jobs:
- name: Run tests with coverage
run: |
echo "Starting tests ..."
poetry run pytest --cov --cov-report term --cov-report xml:coverage.xml tests
poetry run pytest tests/unit
poetry run coverage report
10 changes: 10 additions & 0 deletions src/adapters/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class ExternalError(Exception):
pass


class DatabaseError(ExternalError):
def __init__(self, error: Exception):
self.error = error

def __str__(self) -> str:
return str(self.error)

0 comments on commit 63c8545

Please # to comment.