Skip to content

Commit

Permalink
Merge pull request #126 from fossology/fix/exceptions
Browse files Browse the repository at this point in the history
fix(exceptions): instantiate the inherited exception class
  • Loading branch information
deveaud-m authored Feb 16, 2024
2 parents f8908ee + 61d76e8 commit 892bc28
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 328 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/fossologytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test-latest:
name: Integration Tests (latest Fossology - 4.4.0-rc1)
name: Integration Tests (latest Fossology - 4.4.0)
runs-on: ubuntu-latest

container:
Expand All @@ -20,7 +20,7 @@ jobs:

services:
fossology:
image: fossology/fossology:4.4.0-rc1
image: fossology/fossology:4.4.0
ports:
- 8081:80
volumes:
Expand Down
4 changes: 4 additions & 0 deletions fossology/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, description, response=None):
self.message = f"{description}: {message} ({response.status_code})"
else:
self.message = description
super().__init__(self.message)


class AuthorizationError(Error):
Expand All @@ -33,6 +34,7 @@ def __init__(self, description, response):
except JSONDecodeError:
message = response.text
self.message = f"{description}: {message} ({response.status_code})"
super().__init__(self.message)


class FossologyApiError(Error):
Expand All @@ -44,10 +46,12 @@ def __init__(self, description, response=None):
except JSONDecodeError:
message = response.text
self.message = f"{description}: {message} ({response.status_code})"
super().__init__(self.message)


class FossologyUnsupported(Error):
"""Endpoint or option not supported"""

def __init__(self, description):
self.message = description
super().__init__(self.message)
Loading

0 comments on commit 892bc28

Please sign in to comment.