~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/service.py

  • Committer: Curtis Hovey
  • Date: 2012-03-17 21:05:53 UTC
  • Revision ID: curtis.hovey@canonical.com-20120317210553-03bcgt1j7v9ntvzi
Always return the error reason.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                message = put_input.read(int(self.environ['CONTENT_LENGTH']))
64
64
                self.store.put_message(self.path[0], self.path[1], message)
65
65
                self.send_response(httplib.CREATED)
66
 
            except:
67
 
                self.send_response(httplib.BAD_REQUEST)
 
66
            except Exception, error:
 
67
                self.send_response(
 
68
                    httplib.BAD_REQUEST, reason=error.__doc__)
68
69
        return []
69
70
 
70
71
    def do_POST(self):
77
78
                    self.path[0], self.path[1], self.query_string)
78
79
                self.send_response(httplib.OK)
79
80
                return [simplejson.dumps(response)]
80
 
            except:
81
 
                self.send_response(httplib.BAD_REQUEST)
 
81
            except Exception, error:
 
82
                self.send_response(httplib.BAD_REQUEST, reason=error.__doc__)
82
83
                return []
83
84
 
84
85
    def do_GET(self):