Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Errors handling in web services: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 2: Line 2:


About the exception format (https://docs.moodle.org/dev/Errors_handling_in_web_services#How_to_handle_exception_on_the_client_side):
About the exception format (https://docs.moodle.org/dev/Errors_handling_in_web_services#How_to_handle_exception_on_the_client_side):
* I wonder if 'message' should be translated or not
* Should 'message' be translated or not. I marked it as 'translated' because I thought that as debuginfo should not be translated it would have been a duplicate of information if not translated. And when it's translated it is easier to display it to the user automatically.
* I wonder if 'debuginfo' could have a defined structure like: code_error_string | english_human_message | some_ids_or_json_code_in_order_to_help_client_dev  
* Could'debuginfo' have a defined structure like: code_error_string | english_human_message | some_ids_or_json_code_in_order_to_help_client_dev (note that a json format would look very weird when return by rest-xml/soap/xml-rpc).
* sometimes exceptions are thrown at lower level so except if we try-catch the entire external function we can't change them.
* sometimes exceptions are thrown at lower level so except if we try-catch the entire external function we can't change them.
* we can not change much of the existing web service exception without potentially breaking existing clients.
* we can not change much of the existing web service exception without potentially breaking existing clients.

Revision as of 03:29, 8 May 2012

Jerome Mouneyrac - 08/05/2012

About the exception format (https://docs.moodle.org/dev/Errors_handling_in_web_services#How_to_handle_exception_on_the_client_side):

  • Should 'message' be translated or not. I marked it as 'translated' because I thought that as debuginfo should not be translated it would have been a duplicate of information if not translated. And when it's translated it is easier to display it to the user automatically.
  • Could'debuginfo' have a defined structure like: code_error_string | english_human_message | some_ids_or_json_code_in_order_to_help_client_dev (note that a json format would look very weird when return by rest-xml/soap/xml-rpc).
  • sometimes exceptions are thrown at lower level so except if we try-catch the entire external function we can't change them.
  • we can not change much of the existing web service exception without potentially breaking existing clients.