Source code for synapse.exc

Exceptions used by synapse, all inheriting from SynErr

[docs]class SynErr(Exception): def __init__(self, *args, **info): self.errinfo = info Exception.__init__(self, self._getExcMsg()) def _getExcMsg(self): props = sorted(self.errinfo.items()) displ = ' '.join(['%s=%r' % (p, v) for (p, v) in props]) return '%s: %s' % (self.__class__.__name__, displ)
[docs] def items(self): return {k: v for k, v in self.errinfo.items()}
[docs] def get(self, name, defv=None): ''' Return a value from the errinfo dict. Example: try: foothing() except SynErr as e: blah = e.get('blah') ''' return self.errinfo.get(name, defv)
[docs]class AuthDeny(SynErr): pass
[docs]class BackupAlreadyRunning(SynErr): ''' Only one backup may be running at a time '''
[docs]class StormPkgRequires(SynErr): pass
[docs]class StormPkgConflicts(SynErr): pass
[docs]class BadPkgDef(SynErr): pass
[docs]class BadCmdName(SynErr): pass
[docs]class BadCmprValu(SynErr): pass
[docs]class BadCmprType(SynErr): ''' Attempt to compare two incomparable values '''
[docs]class BadCast(SynErr): pass
[docs]class BadConfValu(SynErr): ''' The configuration value provided is not valid. This should contain the config name, valu and mesg. ''' pass
[docs]class NeedConfValu(SynErr): pass
[docs]class BadCoreStore(SynErr): '''The storage layer has encountered an error''' pass
[docs]class BadCtorType(SynErr): pass
[docs]class BadFormDef(SynErr): pass
[docs]class BadHivePath(SynErr): pass
[docs]class BadLiftValu(SynErr): pass
[docs]class BadPropDef(SynErr): pass
[docs]class BadTypeDef(SynErr): pass
[docs]class BadTypeValu(SynErr): pass
[docs]class BadJsonText(SynErr): pass
[docs]class BadArg(SynErr): ''' Improper function arguments ''' pass
[docs]class BadFileExt(SynErr): pass
[docs]class BadIndxValu(SynErr): pass
[docs]class BadMesgVers(SynErr): pass
[docs]class BadMesgFormat(SynErr): pass
[docs]class BadOperArg(SynErr): ''' Improper storm function arguments ''' pass
[docs]class BadOptValu(SynErr): pass
[docs]class BadVersion(SynErr): '''Generic Bad Version exception.''' pass
[docs]class BadStorageVersion(SynErr): ''' Stored persistent data is incompatible with running software ''' pass
[docs]class BadSyntax(SynErr): pass
[docs]class BadTag(SynErr): pass
[docs]class BadTime(SynErr): pass
[docs]class BadUrl(SynErr): pass
[docs]class CantDelCmd(SynErr): pass
[docs]class CantDelNode(SynErr): pass
[docs]class CantDelForm(SynErr): pass
[docs]class CantDelProp(SynErr): pass
[docs]class CantDelType(SynErr): pass
[docs]class CantDelUniv(SynErr): pass
[docs]class CantMergeView(SynErr): pass
[docs]class CantRevLayer(SynErr): pass
[docs]class CliFini(SynErr): ''' Raised when the CLI is to exit. ''' pass
[docs]class CryptoErr(SynErr): ''' Raised when there is a synapse.lib.crypto error. ''' pass
[docs]class BadEccExchange(CryptoErr): ''' Raised when there is an issue doing a ECC Key Exchange ''' pass
[docs]class PathExists(SynErr): pass
[docs]class DataAlreadyExists(SynErr): ''' Cannot copy data to a location that already contains data ''' pass
[docs]class DbOutOfSpace(SynErr): pass
[docs]class DupName(SynErr): pass
[docs]class DupIden(SynErr): pass
[docs]class DupIndx(SynErr): pass
[docs]class DupFileName(SynErr): pass
[docs]class DupFormName(SynErr): pass
[docs]class DupPropName(SynErr): pass
[docs]class DupRoleName(SynErr): pass
[docs]class DupTagPropName(SynErr): pass
[docs]class DupUserName(SynErr): pass
[docs]class DupStormSvc(SynErr): pass
[docs]class FileExists(SynErr): pass
[docs]class InconsistentStorage(SynErr): ''' Stored persistent data is inconsistent ''' pass
[docs]class IsFini(SynErr): pass
[docs]class IsReadOnly(SynErr): pass
[docs]class IsDeprLocked(SynErr): pass
[docs]class IsRuntForm(SynErr): pass
[docs]class LayerInUse(SynErr): pass
[docs]class LinkErr(SynErr): pass
[docs]class LinkShutDown(LinkErr): pass
[docs]class NoCertKey(SynErr): ''' Raised when a Cert object requires a RSA Private Key to perform an operation and the key is not present. ''' pass
[docs]class NoSuchCert(SynErr): pass
[docs]class BadCertHost(SynErr): pass
[docs]class ModAlreadyLoaded(SynErr): pass
[docs]class MustBeJsonSafe(SynErr): pass
[docs]class NotMsgpackSafe(SynErr): pass
[docs]class NoSuchAbrv(SynErr): pass
[docs]class NoSuchAct(SynErr): pass
[docs]class NoSuchAuthGate(SynErr): pass
[docs]class NoSuchCmd(SynErr): pass
[docs]class NoSuchPkg(SynErr): pass
[docs]class NoSuchCmpr(SynErr): pass
[docs]class NoSuchCond(SynErr): pass
[docs]class NoSuchCtor(SynErr): pass
[docs]class NoSuchDecoder(SynErr): pass
[docs]class NoSuchDir(SynErr): pass
[docs]class NoSuchDyn(SynErr): pass
[docs]class NoSuchEncoder(SynErr): pass
[docs]class NoSuchFile(SynErr): pass
[docs]class NoSuchForm(SynErr): pass
[docs]class NoSuchFunc(SynErr): pass
[docs]class NoSuchIden(SynErr): pass
[docs]class NoSuchImpl(SynErr): pass
[docs]class NoSuchIndx(SynErr): pass
[docs]class NoSuchLayer(SynErr): pass
[docs]class NoSuchLift(SynErr): pass
[docs]class NoSuchMeth(SynErr): pass
[docs]class NoSuchName(SynErr): pass
[docs]class NoSuchObj(SynErr): pass
[docs]class NoSuchOpt(SynErr): pass
[docs]class NoSuchPath(SynErr): pass
[docs]class NoSuchPivot(SynErr): pass
[docs]class NoSuchProp(SynErr): pass
[docs]class NoSuchUniv(SynErr): pass
[docs]class NoSuchRole(SynErr): pass
[docs]class NoSuchType(SynErr): pass
[docs]class NoSuchUser(SynErr): pass
[docs]class NoSuchVar(SynErr): pass
[docs]class NoSuchView(SynErr): pass
[docs]class NoSuchTagProp(SynErr): pass
[docs]class NoSuchStormSvc(SynErr): pass
[docs]class NoSuchStor(SynErr): def __init__(self, name): SynErr.__init__(self, mesg=f'No storage type found named {name!r}', name=name)
[docs]class NotANumberCompared(SynErr): pass
[docs]class ParserExit(SynErr): ''' Raised by synapse.lib.cmd.Parser on Parser exit() ''' pass
[docs]class DmonSpawn(SynErr): ''' Raised by a dispatched telepath method that has answered the call using a spawned process. ( control flow that is compatible with aborting standard calls, generators, and async generators ). ''' pass
[docs]class SchemaViolation(SynErr): pass
[docs]class SlabAlreadyOpen(SynErr): pass
[docs]class SlabInUse(SynErr): pass
[docs]class SpawnExit(SynErr): pass
[docs]class FeatureNotSupported(SynErr): pass
[docs]class HitLimit(SynErr): pass
[docs]class ReadOnlyLayer(SynErr): pass
[docs]class ReadOnlyProp(SynErr): pass
[docs]class RecursionLimitHit(SynErr): pass
[docs]class TimeOut(SynErr): pass
[docs]class Retry(SynErr): pass
[docs]class NotReady(Retry): pass
[docs]class StepTimeout(SynErr): ''' Raised when a TestStep.wait() call times out. ''' pass
[docs]class StormRuntimeError(SynErr): pass
[docs]class StormVarListError(StormRuntimeError): pass
[docs]class TeleRedir(SynErr): pass