RIFT OSM R1 Initial Submission
[osm/SO.git] / common / python / rift / mano / tosca_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 # Copyright 2016 RIFT.io Inc
14
15 '''
16 Exceptions for the TOSCA Translator package.
17 '''
18
19 from rift.mano.tosca_translator.common.utils import _
20
21 from toscaparser.common.exception import TOSCAException
22
23
24 class ConfFileParseError(TOSCAException):
25 msg_fmt = _('%(message)s')
26
27
28 class ConfOptionNotDefined(TOSCAException):
29 msg_fmt = _('Option %(key)s in section %(section)s '
30 'is not defined in conf file')
31
32
33 class ConfSectionNotDefined(TOSCAException):
34 msg_fmt = _('Section %(section)s is not defined in conf file')
35
36
37 class ToscaModImportError(TOSCAException):
38 msg_fmt = _('Unable to import module %(mod_name)s. '
39 'Check to see that it exists and has no '
40 'language definition errors.')
41
42
43 class ToscaClassImportError(TOSCAException):
44 msg_fmt = _('Unable to import class %(name)s in '
45 'module %(mod_name)s. Check to see that it '
46 'exists and has no language definition errors.')
47
48
49 class ToscaClassAttributeError(TOSCAException):
50 msg_fmt = _('Class attribute referenced not found. '
51 '%(message)s. Check to see that it is defined.')