Start a new topic

adding postSave hook causes BL runtime error

Hello,


There are four hooks (post/preFetch and post/preSave ) on one (the root) collection and they seem to work. However, adding either post or preSave hook to another collection causes a BL runtime error if any statement, even a logger.info('onPostSave ' ) call, is there. 

Also, it does seem to save the data even though the client call returns an error.

So this hook does not work:


function onPostSave(request, response, modules) {

 logger.info('onPostSave ' );  

 response.continue();

} 


Thank you


Yes, missed that line. Thanks, Wani!


Regards,

Mark

Hi,


You forgot to get the module logger from the list of modules.


You should either use

var logger = modules.logger;
logger.info('onPostSave');

or

modules.logger.info('onPostSave');


I hope this helps.


Regards,

Wani

Kinvey Support

Login or Signup to post a comment