]> code.ossystems Code Review - openembedded-core.git/commitdiff
Start ditching fatal() calls in favor of raising appropriate exceptions
authorChris Larson <chris_larson@mentor.com>
Thu, 10 Jun 2010 14:47:16 +0000 (07:47 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:36 +0000 (15:41 +0100)
(Bitbake rev: 681b73fcc04e22e692ed61650ad53c800b64cace)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/fetch/__init__.py

index 6478f5acaa48902329e38120f641170722db5a58..e87223ad6b9cacb72c6eac5755aa281eb0aa3b88 100644 (file)
@@ -99,7 +99,7 @@ def encodeurl(decoded):
     (type, host, path, user, pswd, p) = decoded
 
     if not type or not path:
-        bb.msg.fatal(bb.msg.domain.Fetcher, "invalid or missing parameters for url encoding")
+        raise MissingParameterError("Type or path url components missing when encoding %s" % decoded)
     url = '%s://' % type
     if user:
         url += "%s" % user
@@ -166,7 +166,7 @@ def fetcher_init(d):
             pass
         pd.delDomain("BB_URI_HEADREVS")
     else:
-        bb.msg.fatal(bb.msg.domain.Fetcher, "Invalid SRCREV cache policy of: %s" % srcrev_policy)
+        raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
 
     for m in methods:
         if hasattr(m, "init"):
@@ -301,7 +301,7 @@ def checkstatus(d):
                 ret = try_mirrors (d, u, mirrors, True)
 
         if not ret:
-            bb.msg.error(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
+            raise FetchError("URL %s doesn't work" % u)
 
 def localpaths(d):
     """