@Override
	public TextSearchResult search() {
		try {
			if (hasNext()) {
				return next();
			}
		}
		catch (Exception e) {
			// if the tool is busy disassembling or if the program got closed,
			// ignore the exception.
			if (tool.isExecutingCommand()) {
				tool.setStatusInfo("Search failed: try search when tool is not " +
					"executing commands that may change the program");
			}
			else if (!program.isClosed() && program.getCurrentTransactionInfo() != null) {
				tool.setStatusInfo("Search failed: try search when program is not being changed");
			}
			else if (!program.isClosed() && !(e instanceof DomainObjectException)) {
				Msg.showError(this, null, "Error", "Error searching", e);
			}
		}
		return null;
	}
Constructor
@param tool the tool
@param program current program
@param startLocation location from where to begin searching
@param set address set; may be null
@param options search options
@param monitor progress monitor
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcher.java