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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Mar 4 01:19:43 CET 2014


Revision: 23126
          http://sourceforge.net/p/gar/code/23126
Author:   wahwah
Date:     2014-03-04 00:19:43 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
pkgdb-web: Return a meaningful message from rest

When checking if a package exists in a certain catalog, return back parameters
of the query to allow double-checking.

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	2014-03-04 00:19:23 UTC (rev 23125)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2014-03-04 00:19:43 UTC (rev 23126)
@@ -545,7 +545,9 @@
       web.header('Content-type', mimetype)
       return cjson.encode(data)
     except sqlobject.main.SQLObjectNotFound:
-      raise web.notfound('Query returned no results.')
+      data = {'message': 'no %s %s %s %s packages found'
+              % (catrel_name, arch_name, osrel_name, catalogname)}
+      raise web.notfound(cjson.encode(data))
     except sqlobject.dberrors.OperationalError as exc:
       raise web.internalerror(exc)
 

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