# Throw and error

**URL:** https://discourse.julialang.org/t/throw-and-error/109666
**Category:** General Usage
**Tags:** question
**Created:** [February 3, 2024, 12:11pm UTC](https://discourse.julialang.org/t/throw-and-error/109666 "2024-02-03T12:11:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)
#### Post date: [February 3, 2024, 12:11pm UTC](https://discourse.julialang.org/t/throw-and-error/109666/1 "2024-02-03T12:11:28Z")

</div>

```julia
julia> a = 3
3

julia> b = 4
4

julia> throw("a:$a is unequal b:$b")
ERROR: "a:3 is unequal b:4"
Stacktrace:
 [1] top-level scope
   @ REPL[19]:1

```

I am a bit confused here. Is the ‘ERROR’ here indicating that there is some syntax error in my codes, or is it a normal output of throw?

---

<div class="post-metadata">

### Author: ![benslinux](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@benslinux](https://discourse.julialang.org/u/benslinux)
#### Post date: [February 3, 2024, 12:22pm UTC](https://discourse.julialang.org/t/throw-and-error/109666/2 "2024-02-03T12:22:11Z")

</div>

> [@jiang\_ming\_zhang](#):
>
> ```julia
> julia> a = 3
> 3
> 
> julia> b = 4
> 4
> 
> julia> throw("a:$a is unequal b:$b")
> ERROR: "a:3 is unequal b:4"
> Stacktrace:
> [1] top-level scope
> @ REPL[19]:1
> 
> ```

This is normal and expected - when you use the `throw` function, you are explicitly raising an exception with a custom error message. For ex - if you asked user to enter a number and they entered a word (string) instead - you can use ‘throw’ function in your code to politely inform them of the error.
