Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

praekelt / go-http-api / 209

23 Jun 2016 - 6:22 coverage: 97.877% (-1.5%) from 99.392%
209

Pull #21

travis-ci

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
Add AccountApiClient to top-level package.
Pull Request #21: Add support for the JSON-RPC Go API.

151 of 167 new or added lines in 5 files covered. (90.42%)

968 of 989 relevant lines covered (97.88%)

1.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.25
/go_http/exceptions.py
1
""" Exceptions raised by API calls. """
2

3

4
class UserOptedOutException(Exception):
2×
5
    """
6
    Exception raised if a message is sent to a recipient who has opted out.
7

8
    Attributes:
9
        to_addr - The address of the opted out recipient
10
        message - The message content
11
        reason  - The error reason given by the API
12
    """
13
    def __init__(self, to_addr, message, reason):
2×
14
        self.to_addr = to_addr
2×
15
        self.message = message
2×
16
        self.reason = reason
2×
17

18

19
class PagedException(Exception):
2×
20
    """
21
    Exception raised during paged API calls that can be restarted by
22
    specifying a start cursor.
23

24
    Attributes:
25
        cursor - The value of the cursor for which the paged request failed.
26
        error - The exception that occurred.
27
    """
28
    def __init__(self, cursor, error):
2×
29
        self.cursor = cursor
2×
30
        self.error = error
2×
31

32
    def __repr__(self):
33
        return "<PagedException cursor=%r error=%r>" % (
34
            self.cursor, self.error)
35

36
    def __str__(self):
2×
37
        return repr(self)
2×
38

39

40
class JsonRpcException(Exception):
2×
41
    """
42
    Exception raised if a JSON-RPC error is returned.
43

44
    Attributes:
45
        fault - The type of fault (e.g. 'Fault').
46
        fault_code - The error code (e.g. 8002).
47
        fault_string - A string describing the error.
48
    """
49
    def __init__(self, fault, fault_code, fault_string):
2×
NEW
50
        self.fault = fault
!
NEW
51
        self.fault_code = fault_code
!
NEW
52
        self.fault_string = fault_string
!
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2023 Coveralls, Inc