Remove python limitation for codeship
[parser.git] / tosca2heat / heat-translator / translator / common / exception.py
1 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
2 #    not use this file except in compliance with the License. You may obtain
3 #    a copy of the License at
4 #
5 #         http://www.apache.org/licenses/LICENSE-2.0
6 #
7 #    Unless required by applicable law or agreed to in writing, software
8 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 #    License for the specific language governing permissions and limitations
11 #    under the License.
12
13 '''
14 Exceptions for the TOSCA Translator package.
15 '''
16
17 from toscaparser.common.exception import TOSCAException
18 from toscaparser.utils.gettextutils import _
19
20
21 class ConfFileParseError(TOSCAException):
22     msg_fmt = _('%(message)s')
23
24
25 class ConfOptionNotDefined(TOSCAException):
26     msg_fmt = _('Option %(key)s in section %(section)s '
27                 'is not defined in conf file')
28
29
30 class ConfSectionNotDefined(TOSCAException):
31     msg_fmt = _('Section %(section)s is not defined in conf file')
32
33
34 class ToscaModImportError(TOSCAException):
35     msg_fmt = _('Unable to import module %(mod_name)s. '
36                 'Check to see that it exists and has no '
37                 'language definition errors.')
38
39
40 class ToscaClassImportError(TOSCAException):
41     msg_fmt = _('Unable to import class %(name)s in '
42                 'module %(mod_name)s. Check to see that it '
43                 'exists and has no language definition errors.')
44
45
46 class UnsupportedTypeError(TOSCAException):
47     msg_fmt = _('Type "%(type)s" is valid TOSCA type but translation '
48                 'support is not yet available.')
49
50
51 class ToscaClassAttributeError(TOSCAException):
52     msg_fmt = _('Class attribute referenced not found. '
53                 '%(message)s. Check to see that it is defined.')