|
5 | 5 | import java.util.HashMap;
|
6 | 6 | import java.util.Map;
|
7 | 7 | import java.util.function.Consumer;
|
| 8 | +import java.util.function.Function; |
8 | 9 | import okhttp3.HttpUrl;
|
9 | 10 | import okhttp3.MediaType;
|
10 | 11 | import okhttp3.OkHttpClient;
|
@@ -138,6 +139,8 @@ private static void runTracedMethod(String arg) {
|
138 | 139 | tracedMethodWithException(42, "foobar", 3.42, map, "var1", "var2", "var3");
|
139 | 140 | } else if ("deepOops".equals(arg)) {
|
140 | 141 | tracedMethodWithDeepException1(42, "foobar", 3.42, map, "var1", "var2", "var3");
|
| 142 | + } else if ("lambdaOops".equals(arg)) { |
| 143 | + tracedMethodWithLambdaException(42, "foobar", 3.42, map, "var1", "var2", "var3"); |
141 | 144 | } else {
|
142 | 145 | tracedMethod(42, "foobar", 3.42, map, "var1", "var2", "var3");
|
143 | 146 | }
|
@@ -215,6 +218,19 @@ private static void tracedMethodWithDeepException5(
|
215 | 218 | tracedMethodWithException(argInt, argStr, argDouble, argMap, argVar);
|
216 | 219 | }
|
217 | 220 |
|
| 221 | + private static void tracedMethodWithLambdaException( |
| 222 | + int argInt, String argStr, double argDouble, Map<String, String> argMap, String... argVar) { |
| 223 | + throw toRuntimeException("lambdaOops"); |
| 224 | + } |
| 225 | + |
| 226 | + private static RuntimeException toRuntimeException(String msg) { |
| 227 | + return toException(RuntimeException::new, msg); |
| 228 | + } |
| 229 | + |
| 230 | + private static <S extends Throwable> S toException(Function<String, S> constructor, String msg) { |
| 231 | + return constructor.apply(msg); |
| 232 | + } |
| 233 | + |
218 | 234 | private static class AppDispatcher extends Dispatcher {
|
219 | 235 | private final ServerDebuggerTestApplication app;
|
220 | 236 |
|
|
0 commit comments