@Override
		public ConstructTpl compilePcode(String pcodeStatements, String srcFile, int srcLine)
				throws SleighException {
			try {
				return super.compilePcode(pcodeStatements, srcFile, srcLine);
			}
			finally {
				if (getErrors() != 0) {
					throw new DetailedSleighException(entries);
				}
			}
		}
A p-code parser that provides programmatic access to error diagnostics.
Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/SleighProgramCompiler.java