2015-08-21 17:09:46 +02:00
|
|
|
class FeatureLibError(Exception):
|
|
|
|
def __init__(self, message, location):
|
|
|
|
Exception.__init__(self, message)
|
|
|
|
self.location = location
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
message = Exception.__str__(self)
|
|
|
|
if self.location:
|
2020-07-02 14:09:10 +01:00
|
|
|
return f"{self.location}: {message}"
|
2015-08-21 17:09:46 +02:00
|
|
|
else:
|
|
|
|
return message
|
2018-02-21 16:41:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class IncludedFeaNotFound(FeatureLibError):
|
2020-02-27 18:13:45 +00:00
|
|
|
def __str__(self):
|
|
|
|
assert self.location is not None
|
|
|
|
|
|
|
|
message = (
|
|
|
|
"The following feature file should be included but cannot be found: "
|
|
|
|
f"{Exception.__str__(self)}"
|
|
|
|
)
|
2020-07-02 14:09:10 +01:00
|
|
|
return f"{self.location}: {message}"
|