src/main/java/me/senseiwells/arucas/api/ArucasThreadHandler.java
public synchronized void tryError(Context context, Throwable throwable) {
		if (!this.isRunning() || this.hasError || context.getThreadHandler() != this) {
			return;
		}
		try {
			if (throwable instanceof CodeError codeError) {
				if (codeError.errorType != CodeError.ErrorType.INTERRUPTED_ERROR) {
					context.getOutput().println(codeError.toString(context));
					this.hasError = true;
				}
				return;
			}
			this.hasError = true;
			if (throwable instanceof ThrowValue throwValue) {
				context.getOutput().println(throwValue.getMessage());
				return;
			}
			this.fatalErrorHandler.accept(context, throwable, this.currentFileContent);
		}
		finally {
			if (!(Thread.currentThread() instanceof ArucasThread arucasThread) || !arucasThread.isStopControlled()) {
				this.stop();
			}
		}
	}
/**
	 * This allows you to try and submit an error to the thread
	 * which will stop the program unless it was controlled
	 */
This allows you to try and submit an error to the thread
which will stop the program unless it was controlled
This allows you to try and submit an error to the thread which will stop the program unless it was controlled
public synchronized void tryError(Context context, Throwable throwable) {
		if (!this.isRunning() || this.hasError || context.getThreadHandler() != this) {
			return;
		}
		try {
			if (throwable instanceof CodeError codeError) {
				if (codeError.errorType != CodeError.ErrorType.INTERRUPTED_ERROR) {
					context.getOutput().println(codeError.toString(context));
					this.hasError = true;
				}
				return;
			}
			this.hasError = true;
			if (throwable instanceof ThrowValue throwValue) {
				context.getOutput().println(throwValue.getMessage());
				return;
			}
			this.fatalErrorHandler.accept(context, throwable, this.currentFileContent);
		}
		finally {
			if (!(Thread.currentThread() instanceof ArucasThread arucasThread) || !arucasThread.isStopControlled()) {
				this.stop();
			}
		}
	}
public synchronized void tryError ( Context context , Throwable throwable ) { if ( ! this . isRunning ( ) || this . hasError || context . getThreadHandler ( ) != this ) { return ; } try { if ( throwable instanceof CodeError codeError ) { if ( codeError . errorType != CodeError . ErrorType . INTERRUPTED_ERROR ) { context . getOutput ( ) . println ( codeError . toString ( context ) ) ; this . hasError = true ; } return ; } this . hasError = true ; if ( throwable instanceof ThrowValue throwValue ) { context . getOutput ( ) . println ( throwValue . getMessage ( ) ) ; return ; } this . fatalErrorHandler . accept ( context , throwable , this . currentFileContent ) ; } finally { if ( ! ( Thread . currentThread ( ) instanceof ArucasThread arucasThread ) || ! arucasThread . isStopControlled ( ) ) { this . stop ( ) ; } } }
This allows you to try and submit an error to the thread
 which will stop the program unless it was controlled
This allows you to try and submit an error to the thread which will stop the program unless it was controlled