# Catch line number

**URL:** <https://discourse.julialang.org/t/catch-line-number/10729>\
**Category:** General Usage\
**Created:** [May 5, 2018, 7:00pm UTC](https://discourse.julialang.org/t/catch-line-number/10729 "2018-05-05T19:00:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [May 5, 2018, 7:00pm UTC](https://discourse.julialang.org/t/catch-line-number/10729/1 "2018-05-05T19:00:54Z")

</div>

is there a way to determine on what file and line number an error has occurred that was tried-and-caught?

(I don’t think a println(stacktrace()) gives me this, at least not in a way that I can recognize it. At the time of a stacktrace() in the catch, it’s already unwound the stack.)

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 5, 2018, 7:21pm UTC](https://discourse.julialang.org/t/catch-line-number/10729/2 "2018-05-05T19:21:09Z")

</div>

Use `catch_stacktrace()` in your `catch` block instead (or `stacktrace(catch_backtrace())` on 0.7). See [here](https://docs.julialang.org/en/latest/manual/stacktraces/#Error-handling-1) for the relevant docs.
