mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-26 11:18:20 +00:00
Introduce a base exception class PicardScriptError
This commit is contained in:
@@ -57,16 +57,20 @@ class PicardScriptType(IntEnum):
|
|||||||
FILENAMING = 2
|
FILENAMING = 2
|
||||||
|
|
||||||
|
|
||||||
class PicardScriptImportExportError(Exception):
|
class PicardScriptError(Exception):
|
||||||
|
"""Base exception class for PicardScript errors"""
|
||||||
|
|
||||||
|
|
||||||
|
class PicardScriptImportExportError(PicardScriptError):
|
||||||
def __init__(self, *args, format=None, filename=None, error_msg=None):
|
def __init__(self, *args, format=None, filename=None, error_msg=None):
|
||||||
|
super().__init__(*args)
|
||||||
self.format = format
|
self.format = format
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.error_msg = error_msg
|
self.error_msg = error_msg
|
||||||
|
|
||||||
|
|
||||||
class PicardScriptFromFileError(Exception):
|
class PicardScriptFromFileError(PicardScriptError):
|
||||||
def __init__(self, *args):
|
"""Exception raised when converting a file to a PicardScript"""
|
||||||
super().__init__(*args)
|
|
||||||
|
|
||||||
|
|
||||||
class MultilineLiteral(str):
|
class MultilineLiteral(str):
|
||||||
|
|||||||
Reference in New Issue
Block a user