mirror of
https://github.com/volatilityfoundation/volatility
synced 2026-06-08 18:04:46 +00:00
32 lines
998 B
Python
32 lines
998 B
Python
'''
|
|
Created on 6 Feb 2012
|
|
|
|
@author: mike
|
|
'''
|
|
|
|
|
|
class VolatilityException(Exception):
|
|
"""Generic Volatility Specific exception, to help differentiate from other exceptions"""
|
|
def __init__(self, *args, **kwargs):
|
|
Exception.__init__(self, *args, **kwargs)
|
|
|
|
class AddrSpaceError(VolatilityException):
|
|
"""Address Space Exception, so we can catch and deal with it in the main program"""
|
|
def __init__(self):
|
|
self.reasons = []
|
|
VolatilityException.__init__(self, "No suitable address space mapping found")
|
|
|
|
def append_reason(self, driver, reason):
|
|
self.reasons.append((driver, reason))
|
|
|
|
def __str__(self):
|
|
result = VolatilityException.__str__(self) + "\nTried to open image as:\n" #pylint: disable-msg=E1101
|
|
for k, v in self.reasons:
|
|
result += " {0}: {1}\n".format(k, v)
|
|
|
|
return result
|
|
|
|
class CacheRelativeURLException(VolatilityException):
|
|
"""Exception for gracefully not saving Relative URLs in the cache"""
|
|
|