Set default error in mapping table
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 28 May 2023 21:41:03 +0000 (23:41 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 28 May 2023 21:41:03 +0000 (23:41 +0200)
music_assistant/common/models/errors.py

index 9e3693c3b3f2348dbcfe3c87e6051bce4443db39..44394cd091e81ce1c226f97cf852fb5690d86666 100644 (file)
@@ -1,8 +1,5 @@
 """Custom errors and exceptions."""
 
-# mapping from error_code to Exception class
-ERROR_MAP: dict[int, type] = {}
-
 
 class MusicAssistantError(Exception):
     """Custom Exception for all errors."""
@@ -15,6 +12,10 @@ class MusicAssistantError(Exception):
         ERROR_MAP[cls.error_code] = cls
 
 
+# mapping from error_code to Exception class
+ERROR_MAP: dict[int, type] = {0: MusicAssistantError}
+
+
 class ProviderUnavailableError(MusicAssistantError):
     """Error raised when trying to access mediaitem of unavailable provider."""