2015-01-13 18:26:32 -07:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 GNS3 Technologies Inc.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2016-05-11 11:35:36 -06:00
|
|
|
class NodeError(Exception):
|
2015-02-11 14:31:21 +01:00
|
|
|
def __init__(self, message, original_exception=None):
|
2016-03-04 16:11:31 +01:00
|
|
|
super().__init__(message)
|
2015-02-11 14:31:21 +01:00
|
|
|
if isinstance(message, Exception):
|
|
|
|
message = str(message)
|
|
|
|
self._message = message
|
|
|
|
self._original_exception = original_exception
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return self._message
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self._message
|
2016-06-07 15:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ImageMissingError(Exception):
|
|
|
|
"""
|
|
|
|
Raised when an image is missing
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, image):
|
2021-04-13 18:37:58 +09:30
|
|
|
super().__init__(f"The image '{image}' is missing")
|
2016-06-07 19:38:01 +02:00
|
|
|
self.image = image
|