⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to debug callback function



Laurent Nunenthal
  • profile picture
  • Member

Posted 20 February 2017 - 15:42 PM

Hello,

 

I'm new in GC, after 3 days of work, I created a little backend which is working, with some ajax function called, image resizing and more. All is working and it's clear than GC is a good piece of code, thank's

 

My problem is that I have a little complicated code which is called by a callback, and there is no error diplayed when it's occurs. So, it's very difficult to debug. What is the best method to get the error message.

 

Thank's for all.


Amit Shah
  • profile picture
  • Member

Posted 22 February 2017 - 07:01 AM

Well can u mention as where exactly you want to debug callback function .. @what level .. display / insert / update - 

 

display i believe its easily traceable. Insert / updates at times are the ones which can be troublesome ...Well 1st thing i work out on the same is.. i kill the process - die("Got in here")..

When u do that - the same will generate the output in the network call response - that is where then u can start debugging. Since the ajax call expected a json response and a proper response - it will fallback on the same and stop further execution. So your add / update wont work at all beyond this point. 

 

Hope this helps you resolve your query / quest to debug the callback methods.

 

Happy GCing :)


titu
  • profile picture
  • Member

Posted 22 February 2017 - 10:22 AM

Although callbacks allow fast development I would suggest to move to custom models as soon as you can, it simple and you have much more control.