[973924]: / qiita_core / exceptions.py

Download this file

74 lines (49 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
from configparser import Error as ConfigParser_Error
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------
class QiitaError(Exception):
"""Base clase for all Qiita exceptions"""
pass
class IncompetentQiitaDeveloperError(QiitaError):
"""Exception for developer errors"""
pass
class QiitaSearchError(QiitaError):
"""Exception for errors when using search objects"""
pass
class QiitaUserError(QiitaError):
"""Exception for error when handling with user objects"""
pass
class QiitaAnalysisError(QiitaError):
"""Exception for error when handling with analysis objects"""
pass
class QiitaJobError(QiitaError):
"""Exception for error when handling with job objects"""
pass
class QiitaStudyError(QiitaError):
"""Exception for error when handling with study objects"""
pass
class IncorrectPasswordError(QiitaError):
"""User passes wrong password"""
pass
class IncorrectEmailError(QiitaError):
"""Email fails validation"""
pass
class UnverifiedEmailError(QiitaError):
"""Email has not been validated"""
pass
class QiitaEnvironmentError(QiitaError):
"""Exception for error when dealing with the environment"""
pass
class MissingConfigSection(ConfigParser_Error):
"""Exception when the config file is missing a required section"""
def __init__(self, section):
super(MissingConfigSection, self).__init__('Missing section(s): %r' %
(section,))
self.section = section
self.args = (section,)