001package arez; 002 003import grim.annotations.OmitType; 004import javax.annotation.Nonnull; 005import javax.annotation.Nullable; 006 007/** 008 * Interface for handling errors in observers. 009 */ 010@FunctionalInterface 011@OmitType( unless = "arez.enable_observer_error_handlers" ) 012public interface ObserverErrorHandler 013{ 014 /** 015 * Report an error in observer. 016 * 017 * @param observer the observer that generated error. 018 * @param error the type of the error. 019 * @param throwable the exception that caused error if any. 020 */ 021 void onObserverError( @Nonnull Observer observer, @Nonnull ObserverError error, @Nullable Throwable throwable ); 022}