[Coverage] Move exception class in the relevant class

BZ: 115218

Some exceptions were raised only by a particular class. As a result they
were polluting the global namespace.

Nested the exception class.

Change-Id: Icde35d8d2f551a638b97d94bc0a770f70787c723
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/112710
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/tools/coverage.py b/tools/coverage.py
index 6c4345c..f62fd9a 100755
--- a/tools/coverage.py
+++ b/tools/coverage.py
@@ -468,24 +468,28 @@
 
 		currentcriteria.parentUsed()
 
-class IneligibleConfigurationAppliedError(CustomError):
-
-	def __init__(self, configuration, criteria):
-		self.configuration = configuration
-		self.criteria = criteria
-
-	def __str__(self):
-
-		return ("Applying ineligible %s, "
-			"rule:\n%s\n"
-			"Criteria current state:\n%s" %
-			(self.configuration, self.configuration.rootRule.dump(), self.criteria.dump()))
 
 
 class Configuration(FromDomElement, DomPopulatedElement):
 	tag = "Configuration"
 	childClasses = []
 
+	class IneligibleConfigurationAppliedError(CustomError):
+
+		def __init__(self, configuration, criteria):
+			self.configuration = configuration
+			self.criteria = criteria
+
+		def __str__(self):
+
+			return ("Applying ineligible %s, "
+				"rule:\n%s\n"
+				"Criteria current state:\n%s" % (
+					self.configuration,
+					self.configuration.rootRule.dump(withCoverage=False, withNbUse=False),
+					self.criteria.dump(withCoverage=False, withNbUse=False)
+					))
+
 	def __init__(self, DomElement):
 		super().__init__(DomElement)
 
@@ -520,7 +524,7 @@
                        "criteria (parent: %s) " % self.parent.name,
 					logging.FATAL)
 
-			raise IneligibleConfigurationAppliedError(self, criteria.export())
+			raise self.IneligibleConfigurationAppliedError(self, criteria.export())
 
 	def _dumpPropagate(self, withCoverage, withNbUse):
 		self.debug("Going to ask %s for description" % self.rootRule)