basic_parser::fail

## `basic_parser::fail`

Indicate a parsing failure.

### Synopsis

    void
    fail(
        boost::system::error_code ec) noexcept;

### Description

This changes the state of the parser to indicate that the parse has failed. A parser implementation can use this to fail the parser if needed due to external inputs.

| If `! ec.failed()`, an implementation-defined error code that indicates failure will be stored instead.

### Complexity

Constant.

### Exception Safety

No-throw guarantee.

### Parameters

Name | Description
--- | ---
`ec` | The error code to set.

Edit this page