class BoltRequestMessageReader {

    public void read( Neo4jPack.Unpacker unpacker ) throws IOException
    {
        try
        {
            doRead( unpacker );
        }
        catch ( BoltIOException e )
        {
            if ( e.causesFailureMessage() )
            {
                Neo4jError error = Neo4jError.from( e );
                connection.enqueue( stateMachine -> stateMachine.handleExternalFailure( error, externalErrorResponseHandler ) );
            }
            else
            {
                throw e;
            }
        }
    }

    protected  BoltRequestMessageReader( BoltConnection connection, BoltResponseHandler externalErrorResponseHandler,
            List<RequestMessageDecoder> decoders );

}