# Show the full error stacktrace in REPL and pipe it to a file?

**URL:** <https://discourse.julialang.org/t/show-the-full-error-stacktrace-in-repl-and-pipe-it-to-a-file/57339>\
**Category:** New to Julia\
**Created:** [March 16, 2021, 9:14pm UTC](https://discourse.julialang.org/t/show-the-full-error-stacktrace-in-repl-and-pipe-it-to-a-file/57339 "2021-03-16T21:14:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimlaberinto](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimlaberinto/32/21534_2.png) [@kimlaberinto](https://discourse.julialang.org/u/kimlaberinto)\
**Post date:** [March 16, 2021, 9:14pm UTC](https://discourse.julialang.org/t/show-the-full-error-stacktrace-in-repl-and-pipe-it-to-a-file/57339/1 "2021-03-16T21:14:44Z")

</div>

Once an error occurs and the REPL shows the error and the stacktrace, is there a good way to record it and pipe/record it to a file just from the REPL?

```julia
julia> myFunction()
ERROR: Error in module.
Stacktrace:
 [1] myModuleFunction() at /myModule.jl:6
 [2] myOtherFunction() at /main.jl:10
 [3] myFunction() at /main.jl:6
 [4] top-level scope at REPL[2]:1

julia> [Maybe a command here to pipe the above stacktrace to a file?]

```

One of my main issues that prevent me from just copy and pasting is that sometimes I get errors that consume the whole REPL and I can’t even scroll up anymore. Sometimes this even happens when I have the REPL fullscreen in a terminal window.

Other times it’d just be nice have a REPL feature that allows this to be done. So I was wondering if anyone had any ideas.

Going over the Julia docs, I found the [StackTraces module](https://docs.julialang.org/en/v1/manual/stacktraces/), but when I call `stacktrace(catch_backtrace())` in the REPL after the the error occured, it just gives me something empty. I can try wrapping my function in a try-catch block after-the-fact and rerunning it but I might get the error after a long time and don’t want to rerun the function I just ran.
