whisperback (1.8.3)
[whisperback.git] / whisperBack / exceptions.py
blob8583b13bd6e6dea764fcb406933caef65c390acf
1 #!/usr/bin/env python3
2 # -*- coding: UTF-8 -*-
4 ########################################################################
5 # WhisperBack - Send feedback in an encrypted mail
6 # Copyright (C) 2009-2018 Tails developers <tails@boum.org>
8 # This file is part of WhisperBack
10 # WhisperBack is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
15 # This program is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ########################################################################
24 """Base exceptions for whisperback
26 """
28 class WhisperbackException(Exception):
29 """Base class for all exceptions raised by WhisperBack"""
30 pass
32 # Used in whisperback.py
34 class MisconfigurationException(WhisperbackException):
35 """This exception is raised when the configuartion can't be properly
36 loaded
38 """
39 def __init__(self, variable):
40 WhisperbackException.__init__(self,
41 _("The %s variable was not found in any of the configuration files "
42 "/etc/whisperback/config.py, ~/.whisperback/config.py, or ./config.py")
43 % variable)
45 # Used in encryption.py
47 class EncryptionException (WhisperbackException):
48 """This exception is raised when GnuPG fails to encrypt the data"""
49 pass