---
title: "error(_:)"
framework: swift
role: symbol
role_heading: Macro
path: "swift/error(_:)"
---

# error(_:)

Emits the given message as a fatal error and terminates the compilation process.

## Declaration

```swift
@freestanding(declaration) macro error(_ message: String)
```

## Parameters

- `message`: The error message.

## See Also

### Generating Compile-Time Diagnostics

- [warning(_:)](swift/warning(_:).md)
