Skip to content

Commit

Permalink
chore: tidy up exceptions (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Jan 24, 2024
1 parent 41d8217 commit 03213ed
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions src/dsp_tools/models/exceptions.py
Expand Up @@ -43,9 +43,7 @@ def __init__(self, custom_msg: str | None = None, keep_default_msg: bool = True)


class RetryError(BaseError):
"""
A class for errors where the user should try again later.
"""
"""A class for errors where the user should try again later."""

def __init__(self, custom_msg: str | None = None, keep_default_msg: bool = True) -> None:
default_msg = (
Expand All @@ -68,9 +66,7 @@ def __init__(self, custom_msg: str | None = None, keep_default_msg: bool = True)


class InputError(BaseError):
"""
Class for errors that is called when the user input is invalid.
"""
"""Class for errors that is called when the user input is invalid."""


class UserError(BaseError):
Expand All @@ -83,29 +79,12 @@ class UserError(BaseError):


class PermanentConnectionError(BaseError):
"""
This error is raised when all attempts to reconnect to DSP have failed.
Attributes:
message: A message that describes the error
"""

message: str
"""This error is raised when all attempts to reconnect to DSP have failed."""


class BadCredentialsError(PermanentConnectionError):
"""This error is raised when DSP-API doesn't accept the prodived credentials."""


class XmlUploadError(BaseError):
"""
Represents an error raised in the context of the XML import.
"""

_message: str

def __init__(self, msg: str):
self._message = msg

def __str__(self) -> str:
return f"XML-ERROR: {self._message}"
"""Represents an error raised in the context of the xmlupload."""

0 comments on commit 03213ed

Please sign in to comment.