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);
}
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);
}
Aggregations