# E4127

Type is not an error type.

MoonBit only allows error types (defined with `suberror`) to appear after
`raise` in the return type of a function.

## Erroneous example

```{literalinclude} /sources/error_codes/4127_error/top.mbt
:language: moonbit
```

## Suggestion

You can wrap the type you wish to raise in an error type:

```{literalinclude} /sources/error_codes/4127_fixed/top.mbt
:language: moonbit
```
