private void handleError(DomainObjectChangedEvent event) {
		DomainObjectChangeRecord rec = event.findFirst(ERROR);
		if (event.getSource() instanceof Program program) {
			String msg = getErrorMessage(program, (Throwable) rec.getNewValue());
			Msg.showError(this, tool.getToolFrame(), "Severe Error Condition", msg);
			removeProgram(program);
		}
	}
Class for tracking open programs in the tool.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/MultiProgramManager.java