From 0ada33d2b10cde247484e765bccad5f359494056 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 30 Mar 2013 22:54:29 -0400 Subject: [PATCH] Provide more opacity into exceptions. --- .../java/com/google/bitcoin/core/FullPrunedBlockChain.java | 4 ++-- .../com/google/bitcoin/core/FullPrunedBlockChainTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/FullPrunedBlockChain.java b/core/src/main/java/com/google/bitcoin/core/FullPrunedBlockChain.java index 473fb4b4..6a1bbb07 100644 --- a/core/src/main/java/com/google/bitcoin/core/FullPrunedBlockChain.java +++ b/core/src/main/java/com/google/bitcoin/core/FullPrunedBlockChain.java @@ -232,7 +232,7 @@ public class FullPrunedBlockChain extends AbstractBlockChain { throw new RuntimeException(thrownE); // Shouldn't happen } catch (ExecutionException thrownE) { log.error("Script.correctlySpends threw a non-normal exception: " + thrownE.getCause()); - throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way."); + throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way.", thrownE); } if (e != null) throw e; @@ -356,7 +356,7 @@ public class FullPrunedBlockChain extends AbstractBlockChain { throw new RuntimeException(thrownE); // Shouldn't happen } catch (ExecutionException thrownE) { log.error("Script.correctlySpends threw a non-normal exception: " + thrownE.getCause()); - throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way."); + throw new VerificationException("Bug in Script.correctlySpends, likely script malformed in some new and interesting way.", thrownE); } if (e != null) throw e; diff --git a/core/src/test/java/com/google/bitcoin/core/FullPrunedBlockChainTest.java b/core/src/test/java/com/google/bitcoin/core/FullPrunedBlockChainTest.java index 44a1efdb..8d1961f1 100644 --- a/core/src/test/java/com/google/bitcoin/core/FullPrunedBlockChainTest.java +++ b/core/src/test/java/com/google/bitcoin/core/FullPrunedBlockChainTest.java @@ -83,7 +83,7 @@ public class FullPrunedBlockChainTest { threw = true; if (!block.throwsException) { log.error("Block didn't match throws flag on block " + block.blockName); - fail(); + throw e; } if (block.connects) { log.error("Block didn't match connects flag on block " + block.blockName);