# Semantics of \`@error\`

**URL:** https://discourse.julialang.org/t/semantics-of-error/103760
**Category:** New to Julia
**Tags:** question
**Created:** [September 11, 2023, 8:53pm UTC](https://discourse.julialang.org/t/semantics-of-error/103760 "2023-09-11T20:53:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)
#### Post date: [September 11, 2023, 8:53pm UTC](https://discourse.julialang.org/t/semantics-of-error/103760/1 "2023-09-11T20:53:08Z")

</div>

In [doctest and CitationBibliography · Issue #34 · JuliaDocs/DocumenterCitations.jl · GitHub](https://github.com/JuliaDocs/DocumenterCitations.jl/issues/34#issuecomment-1714555097), the question came up what the semantics of the `@error` macro should be. Specifically, whether execution should continue after an `@error` message.

Personally, I’ve been using the following mental model:

- `error(msg)`: Fatal error, execution cannot continue
- `@warn msg`: There’s something that needs the user’s attention (but it might be ok)
- `@error msg`: There’s something wrong. We can keep running, but the user is definitely not getting the result they’re expecting.

That is, `@error` doesn’t necessarily have to be fatal — although it can be: I’ve also used `@error` to give additional context immediately before a call to `error`.

Is there a general consensus in the community as to what the appropriate semantics of `@error` and `@warn` are?

---

<div class="post-metadata">

### Author: ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)
#### Post date: [September 11, 2023, 9:00pm UTC](https://discourse.julialang.org/t/semantics-of-error/103760/2 "2023-09-11T21:00:05Z")

</div>

`@error` is non-fatal. It just means log a message with error severity. Your application may recover or you may want to terminate execution afterwards. But `@error`, `@warn` etc are log-statements nothing more or less 🙂
