# Embedded julia catch exception

**URL:** https://discourse.julialang.org/t/embedded-julia-catch-exception/123287
**Category:** General Usage
**Tags:** embedding, exception, c
**Created:** [November 30, 2024, 12:30pm UTC](https://discourse.julialang.org/t/embedded-julia-catch-exception/123287 "2024-11-30T12:30:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)
#### Post date: [November 30, 2024, 12:30pm UTC](https://discourse.julialang.org/t/embedded-julia-catch-exception/123287/1 "2024-11-30T12:30:45Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Sergey](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Sergey](https://discourse.julialang.org/u/Sergey)
#### Post date: [December 3, 2024, 12:10pm UTC](https://discourse.julialang.org/t/embedded-julia-catch-exception/123287/2 "2024-12-03T12:10:16Z")

</div>

JL\_TRY and JL\_CATCH solve the issue
