aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java
public void checkForErrorResponse()
    {
        lock.lock();
        try
        {
            ensureOpen();

            if (controlResponsePoller.poll() != 0 && controlResponsePoller.isPollComplete())
            {
                if (controlResponsePoller.controlSessionId() == controlSessionId &&
                    controlResponsePoller.templateId() == ControlResponseDecoder.TEMPLATE_ID &&
                    controlResponsePoller.code() == ControlResponseCode.ERROR)
                {
                    final ArchiveException ex = new ArchiveException(
                        controlResponsePoller.errorMessage(), (int)controlResponsePoller.relevantId());

                    if (null != context.errorHandler())
                    {
                        context.errorHandler().onError(ex);
                    }
                    else
                    {
                        throw ex;
                    }
                }
            }
        }
        finally
        {
            lock.unlock();
        }
    }
public void checkForErrorResponse()
    {
        lock.lock();
        try
        {
            ensureOpen();

            if (controlResponsePoller.poll() != 0 && controlResponsePoller.isPollComplete())
            {
                if (controlResponsePoller.controlSessionId() == controlSessionId &&
                    controlResponsePoller.templateId() == ControlResponseDecoder.TEMPLATE_ID &&
                    controlResponsePoller.code() == ControlResponseCode.ERROR)
                {
                    final ArchiveException ex = new ArchiveException(
                        controlResponsePoller.errorMessage(), (int)controlResponsePoller.relevantId());

                    if (null != context.errorHandler())
                    {
                        context.errorHandler().onError(ex);
                    }
                    else
                    {
                        throw ex;
                    }
                }
            }
        }
        finally
        {
            lock.unlock();
        }
    }
Check if an error has been returned for the control session and throw a {@link ArchiveException} if
{@link Context#errorHandler(ErrorHandler)} is not set.
<p>
To check for an error response without raising an exception then try {@link #pollForErrorResponse()}.

@see #pollForErrorResponse()