private static String computeMessage(String message, Object value, DataType dt,
			Throwable cause) {
		if (cause != null) {
			String encodeError = "while encoding '" + value + "' for " + dt.getDisplayName();
			if (message != null) {
				return cause.getMessage() + " (" + encodeError + ": " + message + ")";
			}
			else {
				return cause.getMessage() + "(" + encodeError + ")";
			}
		}
		else {
			String encodeError = "Cannot encode '" + value + "' for " + dt.getDisplayName();
			if (message != null) {
				return encodeError + ": " + message;
			}
			else {
				return encodeError;
			}
		}
	}
Exception thrown when a value cannot be encoded for a data type
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeEncodeException.java