1#!/usr/bin/env python3
 2
 3"""Common exceptions raised by SID classes."""
 4
 5class SIDException(Exception):
 6    pass
 7
 8class BadSID(SIDException):
 9    """SID was constructed using invalid constructor arguments."""
10    def __init__(self, source, message=None):
11        if message is None:
12            self.message = 'Cannot decode source "{s}"'.format(s=source)
13
14        else:
15            self.message = message
16
17    def __str__(self):
18        return self.message
19
20class NoSuchSID(SIDException):
21    pass