Passed
Push — develop ( c6fa42...950d5f )
by Dean
02:50
created

ConnectionError.__str__()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 1
cts 2
cp 0.5
rs 10
cc 1
crap 1.125
1 1
from exception_wrappers import DisabledError
2
3
4 1
class AccountAuthenticationError(Exception):
5 1
    pass
6
7
8 1
class ConnectionError(Exception):
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in ConnectionError.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
9 1
    def __init__(self, message):
0 ignored issues
show
Bug introduced by
The __init__ method of the super-class Exception is not called.

It is generally advisable to initialize the super-class by calling its __init__ method:

class SomeParent:
    def __init__(self):
        self.x = 1

class SomeChild(SomeParent):
    def __init__(self):
        # Initialize the super class
        SomeParent.__init__(self)
Loading history...
10
        self.message = message
11
12 1
    def __str__(self):
13
        return '%s: %s' % (
14
            self.__class__.__name__,
15
            self.message
16
        )
17
18 1
    def __repr__(self):
19
        return '%s(%r)' % (
20
            self.__class__.__name__,
21
            self.message
22
        )
23
24
25 1
class PluginDisabledError(DisabledError):
26 1
    def __init__(self, inner_exception=None):
27
        super(PluginDisabledError, self).__init__(
28
            'Plugin has been automatically disabled, check the plugin logs for more information',
29
            inner_exception
30
        )
31