Search in sources :

Example 1 with OperatorException

use of io.javaoperatorsdk.operator.OperatorException in project java-operator-sdk by java-operator-sdk.

the class EventSourceManager method registerEventSource.

public final void registerEventSource(EventSource eventSource) throws OperatorException {
    Objects.requireNonNull(eventSource, "EventSource must not be null");
    lock.lock();
    try {
        eventSources.add(eventSource);
        eventSource.setEventHandler(eventProcessor);
    } catch (Throwable e) {
        if (e instanceof IllegalStateException || e instanceof MissingCRDException) {
            // leave untouched
            throw e;
        }
        throw new OperatorException("Couldn't register event source: " + eventSource.getClass().getName(), e);
    } finally {
        lock.unlock();
    }
}
Also used : MissingCRDException(io.javaoperatorsdk.operator.MissingCRDException) OperatorException(io.javaoperatorsdk.operator.OperatorException)

Aggregations

MissingCRDException (io.javaoperatorsdk.operator.MissingCRDException)1 OperatorException (io.javaoperatorsdk.operator.OperatorException)1