Errors handling in web services: Difference between revisions
From MoodleDocs
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
REST: | REST: | ||
<code xml> | |||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<EXCEPTION class="invalid_parameter_exception"> | <EXCEPTION class="invalid_parameter_exception"> | ||
Line 19: | Line 20: | ||
<DEBUGINFO></DEBUGINFO> | <DEBUGINFO></DEBUGINFO> | ||
</EXCEPTION> | </EXCEPTION> | ||
</code> | |||
XMLRPC/SOAP: respective error format | XMLRPC/SOAP: respective error format |
Revision as of 07:12, 9 March 2012
I'm looking at how we return errors in the current Moodle web services. Here is the status:
- exceptions are raised: 16 functions
- string error messages: 2 functions (create notes / send messages)
- download/upload script return string error message (JSON) + error code
- When exception are raised, a unique error message is returned. It is format by the protocol server.
REST:
<?xml version="1.0" encoding="UTF-8"?>
<EXCEPTION class="invalid_parameter_exception">
<MESSAGE>Invalid parameter value detected</MESSAGE>
<DEBUGINFO></DEBUGINFO>
</EXCEPTION>
XMLRPC/SOAP: respective error format