Script: Make a ScriptException message more elaborate.

This commit is contained in:
Andreas Schildbach 2020-03-13 18:40:05 +01:00
parent c6a096678d
commit 0b7bdff6de

View file

@ -219,7 +219,7 @@ public class Script {
chunk = new ScriptChunk(opcode, null);
} else {
if (dataToRead > bis.available())
throw new ScriptException(ScriptError.SCRIPT_ERR_BAD_OPCODE, "Push of data element that is larger than remaining data");
throw new ScriptException(ScriptError.SCRIPT_ERR_BAD_OPCODE, "Push of data element that is larger than remaining data: " + dataToRead + " vs " + bis.available());
byte[] data = new byte[(int)dataToRead];
checkState(dataToRead == 0 || bis.read(data, 0, (int)dataToRead) == dataToRead);
chunk = new ScriptChunk(opcode, data);