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

java.util.logging.ErrorManager Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package java.util.logging;

public class ErrorManager {
	public static final int GENERIC_FAILURE = 0;
	public static final int WRITE_FAILURE = 1;
	public static final int FLUSH_FAILURE = 2;
	public static final int CLOSE_FAILURE = 3;
	public static final int OPEN_FAILURE = 4;
	public static final int FORMAT_FAILURE = 5;

	private static final String[] FAILURES = new String[]{
		"GENERIC_FAILURE",
		"WRITE_FAILURE", "FLUSH_FAILURE", "CLOSE_FAILURE", "OPEN_FAILURE",
		"FORMAT_FAILURE"
	};

	private boolean called;

	public ErrorManager() {
	}

	public void error(String message, Exception exception, int errorCode) {
		synchronized (this) {
			if (called) {
				return;
			}
			called = true;
		}
		System.err.println(this.getClass().getName() + ": " + FAILURES[errorCode]);
		if (message != null) {
			System.err.println("Error message - " + message);
		}
		if (exception != null) {
			System.err.println("Exception - " + exception);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy