forked from Ultimaker/Uranium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPluginError.py
35 lines (25 loc) · 978 Bytes
/
PluginError.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
## \file PluginError.py
# Error classes that are used by PluginRegistry or other plugins to signal errors.
## A general class for any error raised by a plugin.
class PluginError(Exception):
def __init__(self, error = None): #pylint: disable=bad-whitespace
super().__init__()
self._error = error
def __str__(self):
return self._error
## Raised when a plugin could not be found.
class PluginNotFoundError(Exception):
def __init__(self, name):
super().__init__()
self._name = name
def __str__(self):
return "Could not find plugin " + self._name
## Raised when a plugin provides incorrect metadata.
class InvalidMetaDataError(Exception):
def __init__(self, name):
super().__init__()
self._name = name
def __str__(self):
return "Invalid metadata for plugin " + self._name