juju_scaleway.ProviderAPIError.__init__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
# -*- coding: utf-8 -*-
2
#
3
# Copyright (c) 2014-2015 Online SAS and Contributors. All Rights Reserved.
4
#                         Edouard Bonlieu <[email protected]>
5
#                         Julien Castets <[email protected]>
6
#                         Manfred Touron <[email protected]>
7
#                         Kevin Deldycke <[email protected]>
8
#
9
# Licensed under the BSD 2-Clause License (the "License"); you may not use this
10
# file except in compliance with the License. You may obtain a copy of the
11
# License at http://opensource.org/licenses/BSD-2-Clause
12
13
14
class ConfigError(ValueError):
15
    """ Environments.yaml configuration error.
16
    """
17
18
19
class PrecheckError(ValueError):
20
    """ A precondition check failed.
21
    """
22
23
24
class ConstraintError(ValueError):
25
    """ Specificed constraint is invalid.
26
    """
27
28
29
class TimeoutError(ValueError):
30
    """ Instance could not be provisioned before timeout.
31
    """
32
33
34
class ProviderError(Exception):
35
    """Instance could not be provisioned.
36
    """
37
38
39
class ProviderAPIError(Exception):
40
41
    def __init__(self, response, message):
42
        self.response = response
43
        self.message = message
44
45
    def __str__(self):
46
        return "<ProviderAPIError message:%s response:%r>" % (
47
            self.message or "Unknown",
48
            self.response.status_code)
49