# FORTRAN STOP leads to exiting Julia REPL

**URL:** <https://discourse.julialang.org/t/fortran-stop-leads-to-exiting-julia-repl/41643>\
**Category:** General Usage\
**Tags:** fortran\
**Created:** [June 18, 2020, 3:26am UTC](https://discourse.julialang.org/t/fortran-stop-leads-to-exiting-julia-repl/41643 "2020-06-18T03:26:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mopg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mopg/32/3368_2.png) [@mopg](https://discourse.julialang.org/u/mopg)\
**Post date:** [June 18, 2020, 3:26am UTC](https://discourse.julialang.org/t/fortran-stop-leads-to-exiting-julia-repl/41643/1 "2020-06-18T03:26:07Z")

</div>

I am wrapping a FORTRAN library that has a bunch of STOP commands in it (to throw errors). However, when I call the library from Julia and one of those errors is reached, the whole process exits (including the Julia REPL). Is this expected? And if so, how can I get around this behavior and simply let an error be thrown on the Julia side of things (`try` `catch` doesn’t seem to have effect here)?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 18, 2020, 3:34am UTC](https://discourse.julialang.org/t/fortran-stop-leads-to-exiting-julia-repl/41643/2 "2020-06-18T03:34:49Z")

</div>

Yes it is expected and no there’s basically no way around it. You need to patch those away to report the error in a different way and recompile the FORTRAN library . This is exactly why such code should never be used to report errors in a library, just like abort in C.

---

<div class="post-metadata">

**Author:** ![mopg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mopg/32/3368_2.png) [@mopg](https://discourse.julialang.org/u/mopg)\
**Post date:** [June 18, 2020, 3:36am UTC](https://discourse.julialang.org/t/fortran-stop-leads-to-exiting-julia-repl/41643/3 "2020-06-18T03:36:23Z")

</div>

Alright, so the fun begins. Thanks for the help!
