From b872fc81232056900ee23a36337b93f4f2b01028 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 15 Jul 2022 12:52:19 +0100 Subject: [PATCH] Only wrap non-RuntimeExceptions See gh-828 --- .../templates/StandardTemplateResourceResolverTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java index 31ba2047..30e45bc5 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java @@ -110,6 +110,9 @@ public class StandardTemplateResourceResolverTests { return action.call(); } catch (Exception ex) { + if (ex instanceof RuntimeException) { + throw (RuntimeException) ex; + } throw new RuntimeException(ex); } finally {