I am trying to look for the best method of returning errors for an asset (JS API) once the script stops and errors have been gathered. Is there a preferred, or used method of doing this in Matrix?
My ideas are, using the destructor method or register_shutdown_function. Are these good ideas, bad ideas, or issues with these?
Best method for returning errors
nnhubbard
(Nic Hubbard)
#1
gsherwood
(Greg Sherwood)
#2
If they are not fatal errors, you could just return them at the end of printFrontend/printBody after you've completed the requested action (or instead of it if it failed).
You would use the shutdown function if you want to try and catch fatal errors because your main processing function will never get all the way to the end.