Search in sources :

Example 6 with MessageClass

use of io.spine.type.MessageClass in project core-java by SpineEventEngine.

the class EventSubscriber method onError.

/**
 * Logs the error into the subscriber {@linkplain #log() log}.
 *
 * @param envelope  the message which caused the error
 * @param exception the error
 */
@Override
public void onError(EventEnvelope envelope, RuntimeException exception) {
    checkNotNull(envelope);
    checkNotNull(exception);
    final MessageClass messageClass = envelope.getMessageClass();
    final String messageId = Stringifiers.toString(envelope.getId());
    final String errorMessage = format("Error handling event subscription (class: %s id: %s).", messageClass, messageId);
    log().error(errorMessage, exception);
}
Also used : MessageClass(io.spine.type.MessageClass)

Example 7 with MessageClass

use of io.spine.type.MessageClass in project core-java by SpineEventEngine.

the class ExternalRejectionSubscriber method onError.

@Override
public void onError(ExternalMessageEnvelope envelope, RuntimeException exception) {
    checkNotNull(envelope);
    checkNotNull(exception);
    final MessageClass messageClass = envelope.getMessageClass();
    final String messageId = Stringifiers.toString(envelope.getId());
    final String errorMessage = format("Error handling external rejection subscription (class: %s id: %s).", messageClass, messageId);
    log().error(errorMessage, exception);
}
Also used : MessageClass(io.spine.type.MessageClass)

Aggregations

MessageClass (io.spine.type.MessageClass)7 Rejection (io.spine.core.Rejection)1 RejectionClass (io.spine.core.RejectionClass)1 ExternalMessage (io.spine.server.integration.ExternalMessage)1 ExternalMessageClass (io.spine.server.integration.ExternalMessageClass)1 ExternalMessageDispatcher (io.spine.server.integration.ExternalMessageDispatcher)1 ExternalMessageEnvelope (io.spine.server.integration.ExternalMessageEnvelope)1