Introduce new function efl_get_last_error();
efl_get_last_error : This function return last error occurred in the toolkit
One of the most annoying issues for new developers, when developer can not get the error, or what was done wrong, so he does not know If method failed, and even if it is failed, developer does not know exactly at which step things went wrong.
And Since a lot of functions in efl already return void, and we cannot change it or there parameters/
We can introduce efl_get_last_error(); which will return int error code value, which are well defined and user can handle them in the right way.
Example:
efl_evas_object_image_file_set(evas, file_name, Key); If (efl_get_last_error() != EFL_NO_ERROR) { //Handle the error in right way. }
Extra Methods:
efl_get_last_error(); // return last error happened in the process; efl_last_error_clear(); // clear last error happened in the process; efl_error_occure(CALLBACK);// register callback when error occure;
Implementation wise:
1- First step could be modify Error macros like EINA_SAFETY to save error in global var, and return it in efl_get_last_error
2- This can be added step by step.