Open Kilda Java Documentation
exc.py
Go to the documentation of this file.
1 # Copyright 2017 Telstra Open Source
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 
16 
17 class AbstractError(Exception):
18  pass
19 
20 
22  def __init__(self, message, *extra):
23  super().__init__(message, *extra)
24 
25  def __str__(self):
26  return self.args[0]
27 
28 
30  def __init__(self, *extra):
31  super().__init__(
32  'Not enough privileges. Need root right to be able to manage '
33  'network interface.', *extra)
34 
35 
37  def __init__(self, value, details, *extra):
38  super().__init__(value, details, *extra)
39 
40  def __str__(self):
41  return 'Invalid BIND address value {0!r}: {1}.'.format(*self.args)
42 
43 
45  def __init__(self, iface, details, *extra):
46  super().__init__(iface, details, *extra)
47 
48  def __str__(self):
49  return 'Invalid target network interface {0!r}: {1}.'.format(*self.args)
50 
51 
53  def __init__(self, config, details, *extra):
54  super().__init__(config, details, *extra)
55 
56  def __str__(self):
57  return 'Invalid logging config {0!r}: {1}'.format(*self.args)
58 
59 
61  def __init__(self, path, *extra):
62  super().__init__(path)
63 
64  def __str__(self):
65  return 'Can\'t occupy pid file {0!r}: {}'.format(
66  self.args[0], self.__cause__)
67 
68 
70  def __str__(self):
71  return 'Can\'t acquire exclusive lock on pid file {0!r}'.format(
72  *self.args)
73 
74 
76  def __init__(self, path, pid, *extra):
77  super().__init__(path, pid, *extra)
78 
79  def __str__(self):
80  return 'Pid file {0!r} exists and point to alive process {1}'.format(
81  *self.args)
82 
83 
85  def __str__(self):
86  return 'Pid file {0!r} have been stolen by process {1}'.format(
87  *self.args)
88 
89 
91  pass
92 
93 
94 class ServiceLookupError(ServiceError):
95  def __init__(self, pool, key, *extra):
96  super().__init__(pool, key, *extra)
97 
98  def __str__(self):
99  return 'Pool {0!r} have no record with key {1!r}'.format(*self.args)
100 
101 
103  def __init__(self, pool, subject, *extra):
104  super().__init__(pool, subject, *extra)
105 
106  def __str__(self):
107  return (
108  'Can\'t add item {args[1]!r} into {args[0]!r} due to error - '
109  '{cause}').format(args=self.args, cause=self.__cause__)
110 
111 
113  def __init__(self, pool, key, item, *extra):
114  super().__init__(pool, key, item, *extra)
115 
116  def __str__(self):
117  return 'Error during delete operation in {0!r} for key {1!r}'.format(
118  *self.args)
119 
120 
122  def __init__(self, pool, subject, collision, *extra):
123  super().__init__(pool, subject, collision, *extra)
124 
125  def __str__(self):
126  return (
127  'Can\'t add item {args[1]} into {args[0]!r} due to collision '
128  'with existing object {args[2]}').format(args=self.args)
129 
130 
132  def __init__(self, context, klass, *extra):
133  super().__init__(context, klass, *extra)
134 
135  def __str__(self):
136  return '{0!r} don\'t have resource belong to {1}'.format(*self.args)
137 
138 
140  def __init__(self, kind, name, *extra):
141  super().__init__(kind, name, *extra)
142 
143  def __str__(self):
144  return ('System resource manipulation error kind={0} name={1!r}. '
145  '{cause}').format(*self.args, cuase=self.__cause__)
146 
147 
149  def __str__(self):
150  return 'System resource already exists kind={0} name={1!r}'.format(
151  *self.args)
152 
153 
155  def __str__(self):
156  return 'System resource not found kind={0} name={1!r}'.format(
157  *self.args)
158 
159 
161  def __init__(self, kind, name, details, *extra):
162  super().__init__(kind, name, details, *extra)
163 
164  def __str__(self):
165  return 'Can\'t operate with resource kind={0} name={1!r}: {2}'.format(
166  *self.args)
def __init__(self, config, details, extra)
Definition: exc.py:53
def __init__(self, context, klass, extra)
Definition: exc.py:132
def __init__(self, pool, key, extra)
Definition: exc.py:95
def __init__(self, message, extra)
Definition: exc.py:22
def __init__(self, kind, name, extra)
Definition: exc.py:140
def __init__(self, iface, details, extra)
Definition: exc.py:45
def __init__(self, value, details, extra)
Definition: exc.py:37
def __init__(self, path, extra)
Definition: exc.py:61
def __init__(self, pool, key, item, extra)
Definition: exc.py:113
def __init__(self, path, pid, extra)
Definition: exc.py:76
def __init__(self, kind, name, details, extra)
Definition: exc.py:161
def __init__(self, pool, subject, extra)
Definition: exc.py:103
def __init__(self, pool, subject, collision, extra)
Definition: exc.py:122