[csw-devel] SF.net SVN: gar:[21968] csw/mgar/gar/v2/lib/web/pkgdb_web.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Sep 21 11:19:40 CEST 2013


Revision: 21968
          http://gar.svn.sourceforge.net/gar/?rev=21968&view=rev
Author:   wahwah
Date:     2013-09-21 09:19:40 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
pkgdb-web: Throw a 404 on nonexisting catalog

In the timing endpoint.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-09-20 20:11:36 UTC (rev 21967)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-09-21 09:19:40 UTC (rev 21968)
@@ -662,8 +662,11 @@
     catalogname version_string pkgname
     basename md5_sum size deps category i_deps
     """
-    sqo_osrel, sqo_arch, sqo_catrel = models.GetSqoTriad(
-        osrel_name, arch_name, catrel_name)
+    try:
+      sqo_osrel, sqo_arch, sqo_catrel = models.GetSqoTriad(
+          osrel_name, arch_name, catrel_name)
+    except sqlobject.main.SQLObjectNotFound:
+      raise web.notfound()
     rows = list(models.GetCatalogGenerationResult(sqo_osrel, sqo_arch, sqo_catrel))
     def PrepareForJson(row):
       # The size (5th row) is returned as a large integer, which cannot be represented

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list