# I don't get an error messages after a task/ thread failed

**URL:** <https://discourse.julialang.org/t/i-dont-get-an-error-messages-after-a-task-thread-failed/36255>\
**Category:** Internals & Design\
**Created:** [March 20, 2020, 12:12pm UTC](https://discourse.julialang.org/t/i-dont-get-an-error-messages-after-a-task-thread-failed/36255 "2020-03-20T12:12:22Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![xor0110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xor0110/32/7926_2.png) [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Post date:** [June 17, 2022, 12:41pm UTC](https://discourse.julialang.org/t/i-dont-get-an-error-messages-after-a-task-thread-failed/36255/21 "2022-06-17T12:41:18Z")

</div>

Thanks for that code snippet. I’m not sure this way of using `@error` is the ideal, it doesn’t seem to nicely print the backtrace. I’ve modified this code like this:

```julia
macro my_async(ex)
    quote
        Threads.@spawn try
            $(esc(ex))
        catch e
            @error "Exception in task" exception=(e, catch_backtrace())
        end
    end
end

```

[Previous page](https://discourse.julialang.org/t/i-dont-get-an-error-messages-after-a-task-thread-failed/36255.md?page=1)
