> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starknet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# core::panics::panic_with_byte_array

Panics with a `ByteArray` message.
Constructs a panic message by prepending the `BYTE_ARRAY_MAGIC` value and
serializing the provided `ByteArray` into the panic data.

## Signature

```rust theme={null}
pub fn panic_with_byte_array(err: ByteArray) -> never
```

## Examples

```rust theme={null}
use core::panics::panic_with_byte_array;

let error_msg = "An error occurred";
panic_with_byte_array(@error_msg);
```
