librelist archives

« back to archive

All exceptions within Flask/Werkzeug

All exceptions within Flask/Werkzeug

From:
Juancarlo Añez
Date:
2012-05-05 @ 20:46
I don't know what I changed, but now all exceptions caught within
Flask/Werkzeug are reported as originating there instead of in my app.

Any help appreciated.

AttributeError

AttributeError: 'UndefinedError' object has no attribute 'split'
Traceback *(most recent call last)*

   - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *1518*,
   in __call__


   return self.wsgi_app(environ, start_response)

   - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *1506*,
   in wsgi_app


   response = self.make_response(self.handle_exception(e))

   - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *1338*,
   in make_response


   return self.response_class(*rv)

   - File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py",
   line *642*, in __init__


   self.status = status

   - File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py",
   line *748*, in _set_status


   self._status_code = int(self._status.split(None, 1)[0])


AttributeError: 'UndefinedError' object has no attribute 'split'


-- 
Juancarlo *Añez*

Re: [flask] All exceptions within Flask/Werkzeug

From:
linnchord
Date:
2012-05-06 @ 06:55
set DEBUG=False

On 6 May 2012 04:46, Juancarlo Añez <juancarlo.anez@gmail.com> wrote:

> I don't know what I changed, but now all exceptions caught within
> Flask/Werkzeug are reported as originating there instead of in my app.
>
> Any help appreciated.
>
> AttributeError
>
> AttributeError: 'UndefinedError' object has no attribute 'split'
> Traceback *(most recent call last)*
>
>    - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *
>    1518*, in __call__
>
>
>    return self.wsgi_app(environ, start_response)
>
>    - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *
>    1506*, in wsgi_app
>
>
>    response = self.make_response(self.handle_exception(e))
>
>    - File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line *
>    1338*, in make_response
>
>
>    return self.response_class(*rv)
>
>    - File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py",
>    line *642*, in __init__
>
>
>    self.status = status
>
>    - File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py",
>    line *748*, in _set_status
>
>
>    self._status_code = int(self._status.split(None, 1)[0])
>
>
> AttributeError: 'UndefinedError' object has no attribute 'split'
>
>
> --
> Juancarlo *Añez*
>
>

Re: [flask] All exceptions within Flask/Werkzeug

From:
Juancarlo Añez
Date:
2012-05-09 @ 16:16
On Sun, May 6, 2012 at 2:25 AM, linnchord <linnchord@gmail.com> wrote:

> set DEBUG=False


The problem was that I was using werkzeug.run_simple with DEBUG=True. I was
trying to run the app with the ProfilerMiddleware.

-- 
Juancarlo *Añez*