Embedded julia catch exception

Hi.
Im trying to use julia as user function extension.
So i embed it into my qt application.
But if there is an error in julia code everything will crash.
Is it possible to catch julia exceptions from c++ or i could run julia function in threads and watch its state?

Functions also could crash during long execution, but main app should keep working.

Thanks for advises!

JL_TRY and JL_CATCH solve the issue