Did I find the right examples for you? yes no

All Samples(25)  |  Call(25)  |  Derive(0)  |  Import(0)

src/n/o/nova-gce-HEAD/nova/api/gce/wsgi.py   nova-gce(Download)
                                               content_type, body)
        except (AttributeError, TypeError):
            return openstack_wsgi.Fault(webob.exc.HTTPNotFound())
        except KeyError as ex:
            msg = _("There is no such action: %s") % ex.args[0]
            return openstack_wsgi.Fault(webob.exc.HTTPBadRequest(
                explanation=msg))
        except exception.MalformedRequestBody:
            msg = _("Malformed request body")
            return openstack_wsgi.Fault(webob.exc.HTTPBadRequest(
        except exception.InvalidContentType:
            msg = _("Unsupported Content-Type")
            return openstack_wsgi.Fault(webob.exc.HTTPBadRequest(
                explanation=msg))
        except exception.MalformedRequestBody:
            msg = _("Malformed request body")
            return openstack_wsgi.Fault(webob.exc.HTTPBadRequest(

src/n/o/nova-HEAD/nova/api/openstack/__init__.py   nova(Download)
 
        notifications.send_api_fault(req.url, status, inner)
        return wsgi.Fault(outer)
 
    @webob.dec.wsgify(RequestClass=wsgi.Request)

src/n/o/nova-gce-HEAD/nova/api/openstack/__init__.py   nova-gce(Download)
            outer.explanation = '%s: %s' % (inner.__class__.__name__,
                                            unicode(inner))
        return wsgi.Fault(outer)
 
    @webob.dec.wsgify(RequestClass=wsgi.Request)

src/n/o/nova-HEAD/nova/tests/api/openstack/test_faults.py   nova(Download)
 
        for request in requests:
            fault = wsgi.Fault(webob.exc.HTTPBadRequest(explanation='scram'))
            response = request.get_response(fault)
 
            # NOTE(aloga): we intentionally pass an integer for the
            # 'Retry-After' header. It should be then converted to a str
            fault = wsgi.Fault(exc(explanation='sorry',
                        headers={'Retry-After': 4}))
            response = request.get_response(fault)
            # NOTE(aloga): we intentionally pass an integer for the
            # 'Retry-After' header. It should be then converted to a str
            fault = wsgi.Fault(exc(explanation='sorry',
                        headers={'Retry-After': 4}))
            response = request.get_response(fault)
        def raiser(req):
            raise wsgi.Fault(webob.exc.HTTPNotFound(explanation='whut?'))
 
        req = webob.Request.blank('/.xml')
        resp = req.get_response(raiser)
        def raiser(req):
            raise wsgi.Fault(webob.exc.HTTPForbidden(explanation='whut?'))
 
        req = webob.Request.blank('/.xml')
        resp = req.get_response(raiser)

src/n/o/nova-gce-HEAD/nova/tests/api/openstack/test_faults.py   nova-gce(Download)
 
        for request in requests:
            fault = wsgi.Fault(webob.exc.HTTPBadRequest(explanation='scram'))
            response = request.get_response(fault)
 
        for request in requests:
            exc = webob.exc.HTTPRequestEntityTooLarge
            fault = wsgi.Fault(exc(explanation='sorry',
                        headers={'Retry-After': 4}))
            response = request.get_response(fault)
        def raiser(req):
            raise wsgi.Fault(webob.exc.HTTPNotFound(explanation='whut?'))
 
        req = webob.Request.blank('/.xml')
        resp = req.get_response(raiser)
        def raiser(req):
            raise wsgi.Fault(webob.exc.HTTPForbidden(explanation='whut?'))
 
        req = webob.Request.blank('/.xml')
        resp = req.get_response(raiser)
    def test_fault_has_status_int(self):
        """Ensure the status_int is set correctly on faults"""
        fault = wsgi.Fault(webob.exc.HTTPBadRequest(explanation='what?'))
        self.assertEqual(fault.status_int, 400)
 

src/n/o/nova-HEAD/nova/tests/api/openstack/compute/test_api.py   nova(Download)
        def raise_api_fault(req):
            exc = webob.exc.HTTPNotFound(explanation='Raised a webob.exc')
            return wsgi.Fault(exc)
 
        #api.application = raise_api_fault

src/n/o/nova-gce-HEAD/nova/tests/api/openstack/compute/test_api.py   nova-gce(Download)
        def raise_api_fault(req):
            exc = webob.exc.HTTPNotFound(explanation='Raised a webob.exc')
            return wsgi.Fault(exc)
 
        #api.application = raise_api_fault