Tidy up exceptions file.
authorSalim Fadhley <sal@stodge.org>
Sun, 3 Aug 2014 20:01:35 +0000 (21:01 +0100)
committerSalim Fadhley <sal@stodge.org>
Sun, 3 Aug 2014 20:01:35 +0000 (21:01 +0100)
jenkinsapi/custom_exceptions.py

index 5582900b0e70cbbeceeca6848932912014b251be..4573cd79b1645753fb5df7e98b03518106ed52d7 100644 (file)
-"""
-Module for custom_exceptions specialized for jenkinsapi
+"""Module for custom_exceptions.
+
+Where possible we try to throw exceptions with non-generic, 
+meaningful names.
 """
 
 
 class JenkinsAPIException(Exception):
-
-    """
-    Base class for all errors
+    """Base class for all errors
     """
     pass
 
 
 class NotFound(JenkinsAPIException):
-
-    """
-    Resource cannot be found
+    """Resource cannot be found
     """
     pass
 
 
 class ArtifactsMissing(NotFound):
-
-    """
-    Cannot find a build with all of the required artifacts.
+    """Cannot find a build with all of the required artifacts.
     """
     pass
 
 
 class UnknownJob(KeyError, NotFound):
-
-    """
-    Jenkins does not recognize the job requested.
+    """Jenkins does not recognize the job requested.
     """
     pass
 
 
 class UnknownView(KeyError, NotFound):
-
-    """
-    Jenkins does not recognize the view requested.
+    """Jenkins does not recognize the view requested.
     """
     pass
 
 
 class UnknownNode(KeyError, NotFound):
-
-    """
-    Jenkins does not recognize the node requested.
+    """Jenkins does not recognize the node requested.
     """
     pass
 
 
 class UnknownQueueItem(KeyError, NotFound):
-
-    """
-    Jenkins does not recognize the requested queue item
+    """Jenkins does not recognize the requested queue item
     """
     pass
 
 
 class UnknownPlugin(KeyError, NotFound):
-
-    """
-    Jenkins does not recognize the plugin requested.
+    """Jenkins does not recognize the plugin requested.
     """
     pass
 
 
 class NoBuildData(NotFound):
-
-    """
-    A job has no build data.
+    """A job has no build data.
     """
     pass
 
 
 class NotBuiltYet(NotFound):
-
-    """
-    A job has no build data.
+    """A job has no build data.
     """
     pass
 
 
 class ArtifactBroken(JenkinsAPIException):
-
-    """
-    An artifact is broken, wrong
+    """An artifact is broken, wrong
     """
     pass
 
 
 class TimeOut(JenkinsAPIException):
-
-    """
-    Some jobs have taken too long to complete.
+    """Some jobs have taken too long to complete.
     """
     pass
 
 
 class NoResults(JenkinsAPIException):
-
-    """
-    A build did not publish any results.
+    """A build did not publish any results.
     """
     pass
 
 
 class FailedNoResults(NoResults):
-
-    """
-    A build did not publish any results because it failed
+    """A build did not publish any results because it failed
     """
     pass
 
 
 class BadURL(ValueError, JenkinsAPIException):
-
-    """
-    A URL appears to be broken
+    """A URL appears to be broken
     """
     pass
 
 
 class NotAuthorized(JenkinsAPIException):
-
     """Not Authorized to access resource"""
     # Usually thrown when we get a 403 returned
     pass
 
 
 class NotSupportSCM(JenkinsAPIException):
-
     """
     It's a SCM that does not supported by current version of jenkinsapi
     """
@@ -139,32 +109,24 @@ class NotSupportSCM(JenkinsAPIException):
 
 
 class NotConfiguredSCM(JenkinsAPIException):
-
-    """
-    It's a job that doesn't have configured SCM
+    """It's a job that doesn't have configured SCM
     """
     pass
 
 
 class NotInQueue(JenkinsAPIException):
-
-    """
-    It's a job that is not in the queue
+    """It's a job that is not in the queue
     """
     pass
 
 
 class PostRequired(JenkinsAPIException):
-
-    """
-    Method requires POST and not GET
+    """Method requires POST and not GET
     """
     pass
 
 
 class BadParams(JenkinsAPIException):
-
-    """
-    Invocation was given bad or inappropriate params
+    """Invocation was given bad or inappropriate params
     """
     pass