toError method

RespError toError()

Converts this type to an error. Throws a StateError if this is not an error.

Implementation

RespError toError() => throw StateError('${toString()} is not an error!');