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

com.machinezoo.noexception.ExceptionLogger Maven / Gradle / Ivy

Go to download

Makes exception handling concise and beautiful, yet architecturally clean and flexible.

There is a newer version: 1.9.1
Show newest version
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception;

import org.slf4j.*;
import lombok.*;

@RequiredArgsConstructor final class ExceptionLogger extends ExceptionHandler {
	@NonNull private final Logger logger;
	@NonNull private final String message;
	@Override public boolean handle(Throwable exception) {
		if (exception instanceof InterruptedException)
			Thread.currentThread().interrupt();
		logger.error(message, exception);
		return true;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy