Python errors - debug mode?

46 views
Skip to first unread message

Michał Dulko

unread,
Apr 16, 2013, 3:59:20 AM4/16/13
to pytho...@googlegroups.com
So this is how WSME returns errors:

{
    "debuginfo": null,
    "faultcode": "Server",
    "faultstring": "get_all() takes exactly 2 arguments (1 given)"
}

Is there any way to turn some debug mode on to make WSME return traceback? Or just to make it return file and line number of place where exception occurred? I use pecan with WSME and pecan shows everything about exception but WSME strips all the useful information.

Christophe de Vienne

unread,
Apr 16, 2013, 9:15:01 AM4/16/13
to pytho...@googlegroups.com
Hello Michał,

There is a way but the pecan adater is not using it right now.

A quick and dirty way is to change the adapter, wsmeext/pecan.py:72, and add a 'True' parameter to format_exception so that the traceback is included.

I am implementing something better. It will include the debuginfo depending on a wsme.debug configuration variable.

I will let you know when it is ready to test.

Christophe
--
You received this message because you are subscribed to the Google Groups "python-wsme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-wsme...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christophe de Vienne

unread,
Apr 16, 2013, 9:46:54 AM4/16/13
to pytho...@googlegroups.com
Hi again,

I have improved the pecan adapter so that it reads the pecan configuration to enable (or not) debuginfo in server-side errors [1].

You can test it by installing from the hg repo.

Cheers,

Christophe

[1] https://wsme.readthedocs.org/en/latest/integrate.html#configuration

Christophe de Vienne

unread,
Apr 16, 2013, 10:09:43 AM4/16/13
to pytho...@googlegroups.com
By the way, the error you are having looks like a missing argument, which were badly reported in 0.5b1, but it has been fixed since.


Le 16/04/2013 09:59, Michał Dulko a écrit :

Michał Dulko

unread,
Apr 16, 2013, 10:55:21 AM4/16/13
to pytho...@googlegroups.com
Thanks! I'll try it and report how it works with my needs.
Reply all
Reply to author
Forward
0 new messages