Commits

Pior Bastida  committed 94d2afb

added application.ApplicationInvalid

  • Participants
  • Parent commits bf77c1b

Comments (0)

Files changed (1)

File awstools/application.py

 class ApplicationError(Exception):
     pass
 
+
+class ApplicationInvalid(ApplicationError):
+    pass
+
+
 class ApplicationNotFound(ApplicationError):
     pass
 
 
 class Application(object):
     def __init__(self, properties):
+        if not isinstance(properties, dict):
+            raise ApplicationInvalid
         self.model = False
         self.properties = properties
 
             try:
                 getattr(self, prop)
             except KeyError as e:
-                raise Exception("Missing properties: %s" % e)
+                raise ApplicationInvalid("Missing properties: %s" % e)
 
     def _prop(self, prop):
         if prop in self.properties:
             el = parts.pop(0)
             try:
                 int(el)
-            except:
+            except ValueError:
                 environment = el
             else:
                 environment = "production"