* [gentoo-commits] packages:master commit in: web/
@ 2011-11-11 15:47 Christian Ruppert
0 siblings, 0 replies; 3+ messages in thread
From: Christian Ruppert @ 2011-11-11 15:47 UTC (permalink / raw
To: gentoo-commits
commit: 2fe27226d9cb174d980ba7a2c8e0a5076fbc5412
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 11 15:44:32 2011 +0000
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Fri Nov 11 15:44:32 2011 +0000
URL: http://sources.gentoo.org/gitweb/?p=packages.git;a=commit;h=2fe27226
Fix <herd> interpretation to not cause errors
---
web/model.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/web/model.py b/web/model.py
index 8f549fc..68ce012 100644
--- a/web/model.py
+++ b/web/model.py
@@ -623,6 +623,8 @@ class PackageDB(object):
cursor.execute(sql, (cat, pn))
row = cursor.fetchone()
+ if not row:
+ return
ebuildchangeutc = datetime.datetime.utcfromtimestamp(row[0])
package_details = { 'atom': get_atom(str(cp)),
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] packages:master commit in: web/
@ 2012-12-30 17:28 Alec Warner
0 siblings, 0 replies; 3+ messages in thread
From: Alec Warner @ 2012-12-30 17:28 UTC (permalink / raw
To: gentoo-commits
commit: 523745a562104b7c89e29f9f3d284a9688343438
Author: Alec Warner <antarus <AT> scriptkitty <DOT> com>
AuthorDate: Sun Dec 30 17:33:06 2012 +0000
Commit: Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Sun Dec 30 17:33:06 2012 +0000
URL: http://sources.gentoo.org/gitweb/?p=packages.git;a=commit;h=523745a5
Return 404s instead of 500s for many error cases.
---
web/controller.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/web/controller.py b/web/controller.py
index 2275733..b4f5189 100644
--- a/web/controller.py
+++ b/web/controller.py
@@ -517,12 +517,21 @@ def database_connect():
sys.exit(1)
return database
+def handle_error():
+ """Handle any unhandled exceptions.
+ It turns out a lot of our code raises exceptions that cause 500's for users
+ Instead of raising a 500 (for say, an invalid atom) simply return a 404
+ instead. The exception should still get logged.
+ """
+ cherrypy.response.status = 404
+
def main():
"""Use this when we run standalone"""
# site-wide config
cherrypy.config.update({
#'environment': 'production',
+ 'response.error_response' = handle_error,
'log.screen': True,
'log.error_file': '/tmp/cherrypy_packages2.gentoo.log',
@@ -575,7 +584,7 @@ def setup_server():
# if something goes wrong, we get a log.
cherrypy.config.update({
#'environment': 'production',
-
+ 'response.error_response' = handle_error,
'log.screen': False,
'log.error_file': '/tmp/cherrypy_packages2.gentoo.log',
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] packages:master commit in: web/
@ 2013-04-14 22:30 Christian Ruppert
0 siblings, 0 replies; 3+ messages in thread
From: Christian Ruppert @ 2013-04-14 22:30 UTC (permalink / raw
To: gentoo-commits
commit: 0f6b207d02488b57fc8b104383e45e3d5497e03e
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 14 22:30:30 2013 +0000
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org>
CommitDate: Sun Apr 14 22:30:30 2013 +0000
URL: http://sources.gentoo.org/gitweb/?p=packages.git;a=commit;h=0f6b207d
Typo
---
web/controller.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/controller.py b/web/controller.py
index b4f5189..1d32c08 100644
--- a/web/controller.py
+++ b/web/controller.py
@@ -531,7 +531,7 @@ def main():
# site-wide config
cherrypy.config.update({
#'environment': 'production',
- 'response.error_response' = handle_error,
+ 'response.error_response': handle_error,
'log.screen': True,
'log.error_file': '/tmp/cherrypy_packages2.gentoo.log',
@@ -584,7 +584,7 @@ def setup_server():
# if something goes wrong, we get a log.
cherrypy.config.update({
#'environment': 'production',
- 'response.error_response' = handle_error,
+ 'response.error_response': handle_error,
'log.screen': False,
'log.error_file': '/tmp/cherrypy_packages2.gentoo.log',
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-14 22:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 15:47 [gentoo-commits] packages:master commit in: web/ Christian Ruppert
-- strict thread matches above, loose matches on Subject: below --
2012-12-30 17:28 Alec Warner
2013-04-14 22:30 Christian Ruppert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox