All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rollbar.reactivestreams.notifier.ReactorRollbar Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha.1
Show newest version
package com.rollbar.reactivestreams.notifier;

import com.rollbar.reactivestreams.notifier.config.Config;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 

* Async, non-blocking Rollbar notifier with additional helper methods to handle {@link Mono} and * {@link Flux} errors. *

*/ public class ReactorRollbar extends Rollbar { public ReactorRollbar(Config config) { super(config); } /** * Logs the error to Rollbar and returns the original {@link Mono}. * * @param t The error that occurred * @param The type of elements of the Mono * @param The type of the error * @return The original success or failure {@link Mono}, after logging the error to Rollbar */ public Mono logMonoError(E t) { return Mono.from(error(t)).flatMap(ignored -> Mono.error(t)); } /** * Logs the error to Rollbar and returns the original {@link Flux}. * * @param t The error that occurred * @param The type of elements of the Flux * @param The type of the error * @return The original success or failure {@link Flux}, after logging the error to Rollbar */ public Flux logFluxError(E t) { return Flux.from(error(t)).flatMap(ignored -> Flux.error(t)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy