2020-08-29 20:05:15 +02:00
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
class PhiEntryExists(Exception):
|
|
|
|
def __init__(self, dn):
|
|
|
|
self.dn = dn
|
|
|
|
|
2020-11-11 22:25:02 +01:00
|
|
|
def __str__(self):
|
|
|
|
return f"Entry exists yet ({self.dn})"
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return f"PhiEntryExists({self.dn})"
|
|
|
|
|
2020-08-29 20:05:15 +02:00
|
|
|
|
|
|
|
class PhiEntryDoesNotExist(Exception):
|
|
|
|
def __init__(self, dn):
|
|
|
|
self.dn = dn
|
|
|
|
|
2020-11-11 22:25:02 +01:00
|
|
|
def __str__(self):
|
|
|
|
return f"Entry does not exist ({self.dn})"
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return f"PhiEntryDoesNotExist({self.dn})"
|
|
|
|
|
2020-08-29 20:05:15 +02:00
|
|
|
|
|
|
|
class PhiAttributeMissing(Exception):
|
|
|
|
def __init__(self, dn, attr):
|
|
|
|
self.dn = dn
|
|
|
|
self.attr = attr
|
|
|
|
|
|
|
|
|
|
|
|
class PhiUnauthorized(Exception):
|
|
|
|
def __init__(self, user, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.user = user
|
|
|
|
|
|
|
|
|
|
|
|
class PhiUnexpectedRuntimeValue(RuntimeWarning):
|
|
|
|
def __init__(self, msg, result):
|
|
|
|
super().__init__(self)
|
|
|
|
self.msg = msg
|
|
|
|
self.result = result
|
2020-11-11 22:25:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PhiCannotExecute(RuntimeWarning):
|
|
|
|
def __init__(self, msg):
|
|
|
|
super().__init__(self)
|
|
|
|
self.msg = msg
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return f"Cannot execute: {self.msg}"
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return f"PhiCannotExecute({self.msg})"
|