[FIX] bad handling of werkzeug's exceptions