source: mauRepo/MolesManager/trunk/src/libs/migration/exception/exceptions.py @ 8082

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/exception/exceptions.py@8082
Revision 8082, 1.4 KB checked in by mnagni, 9 years ago (diff)

Refactored partially the migration code
Refactored substantially the Model2Form code
Now is visible the "cov" page is visible the relatedParty name (implementation as list possibly in the next commit)

Line 
1'''
2Created on 15 Nov 2011
3
4@author: mnagni
5'''
6
7def _migrationObjectDescription(migrationObject):
8    return "%s %s %s" % (migrationObject.doc_status, migrationObject.doc_owner, migrationObject.doc_name)
9   
10class NoCreationDate(Exception):
11    def __init__(self, value):
12        self.value = value
13    def __str__(self):
14        return "The resource with ID %s has no creation date" % (self.value) 
15
16class MigrationObjectException(Exception):
17    def __init__(self, value):
18        self._migrationObject = value
19    def __str__(self):
20        return "Error on migration object %s " % (_migrationObjectDescription(self._migrationObject))
21
22class NoAssociatedDeployments(Exception):
23    def __init__(self, data_entityMigration, deploymentName):
24        self._migrationObject = data_entityMigration
25        self._deploymentName = deploymentName       
26        super(NoAssociatedDeployments, self).__init__()
27    def __str__(self):
28        return "The DataEntity %s has no associated deployment named %s" % (_migrationObjectDescription(self._migrationObject), self._deploymentName)
29   
30class NoDataLineage(MigrationObjectException):
31    def __init__(self, value):
32        self._migrationObject = value       
33        super(NoDataLineage, self).__init__(self._migrationObject)
34    def __str__(self):
35        return "The DataEntity %s has no moles:lineage value" % (_migrationObjectDescription(self._migrationObject))
Note: See TracBrowser for help on using the repository browser.