# \`@error\` message from module user's point of view

**URL:** <https://discourse.julialang.org/t/error-message-from-module-users-point-of-view/18193>\
**Category:** General Usage\
**Created:** [November 30, 2018, 9:04pm UTC](https://discourse.julialang.org/t/error-message-from-module-users-point-of-view/18193 "2018-11-30T21:04:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgkuhn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgkuhn/32/6276_2.png) [@mgkuhn](https://discourse.julialang.org/u/mgkuhn)\
**Post date:** [November 30, 2018, 9:04pm UTC](https://discourse.julialang.org/t/error-message-from-module-users-point-of-view/18193/1 "2018-11-30T21:04:56Z")

</div>

When I call [`@error`](https://docs.julialang.org/en/v1/stdlib/Logging/#Base.CoreLogging.@logmsg), it includes in the generated log message the filename and line number of where I called `@error`. However, when I am the author of a module, and I called `@error` in order to report that the caller of the module caused an error, then it would be nicer to log the filename and line number where the user of the module called the module, as this is most likely where the user needs to fix the mistake in their code.

Is there a convenient way to raise an `@error` such that the line number displayed is from the module user’s point of view? I can see that `@error` can accept a backtrace value along with an exception and I also found a [`Base.StackTraces.remove_frames!`](https://docs.julialang.org/en/v1/base/stacktraces/#Base.StackTraces.remove_frames!) that removes from a stacktrace all frames related to a module, but I haven’t quite understood yet how these are meant to fit together (as backtraces and stackframes are different types).

Essentially I’m looking for Julia’s equivalent of Perl’s carp() function.
