public <T extends DomainObject> void taskFailed(T obj, BackgroundCommand<T> taskCmd,
			TaskMonitor monitor) {
		try {
			obj.flushEvents();
			clearQueuedCommands(obj);
			if (tool != null) {
				if (!monitor.isCancelled()) {
					monitor.cancel();
					String msg = taskCmd.getStatusMsg();
					if (msg == null || msg.length() == 0) {
						msg = "Unspecified error occurred.";
					}
					Msg.showError(this, tool.getToolFrame(), taskCmd.getName() + " Failed", msg);
				}
				else {
					tool.setStatusInfo(taskCmd.getName() + " cancelled");
				}
			}
		}
		finally {
			if (currentTask.isModal()) {
				modalTaskDialog.taskProcessed();
				modalTaskDialog = null;
			}
			else {
				toolTaskMonitor.taskCompleted(currentTask);
			}
		}
	}
Notification from the BackgroundCommandTask that the given command
failed. Any scheduled commands are cleared from the queue.

@param obj domain object that supports undo/redo
@param taskCmd background command that failed
@param monitor task monitor for the background task
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/mgr/ToolTaskManager.java