[TIMOB-16153] Fixed up the various hook calls to use the correct API and improve error handling.
Merge pull request #5206 from cb1kenobi/timob-16153

[TIMOB-16153] Fixed up the various hook calls to use the correct API and...