Source code for jarkdown.exceptions
"""Custom exceptions for jarkdown."""
[docs]
class JarkdownError(Exception):
"""Base exception for all jarkdown errors."""
pass
[docs]
class JiraApiError(JarkdownError):
"""Raised when there's an error communicating with the Jira API."""
[docs]
def __init__(self, message, status_code=None, response=None):
super().__init__(message)
self.status_code = status_code
self.response = response
[docs]
class AuthenticationError(JiraApiError):
"""Raised when authentication with Jira fails."""
pass
[docs]
class IssueNotFoundError(JiraApiError):
"""Raised when the requested issue is not found."""
pass
[docs]
class AttachmentDownloadError(JarkdownError):
"""Raised when there's an error downloading an attachment."""
[docs]
def __init__(self, message, filename=None):
super().__init__(message)
self.filename = filename
[docs]
class ConfigurationError(JarkdownError):
"""Raised when there's a configuration problem."""
pass