# Exceptions

## class RegexException

```cangjie
public class RegexException <: Exception {
    public init()
    public init(message: String)
}
```

Functionality: Provides exception handling for regular expressions.

Parent Type:

- [Exception](../../core/core_package_api/core_package_exceptions.md#class-exception)

### init()

```cangjie
public init()
```

Functionality: Creates a [RegexException](regex_package_exceptions.md#class-regexexception) instance.

### init(String)

```cangjie
public init(message: String)
```

Functionality: Creates a [RegexException](regex_package_exceptions.md#class-regexexception) instance with exception message.

Parameters:

- message: [String](../../core/core_package_api/core_package_structs.md#struct-string) - Exception prompt message.