• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yuu-nkjm / sorm4j / #518

13 Mar 2025 07:20AM UTC coverage: 93.617% (-0.03%) from 93.65%
#518

push

Yuu NAKAJIMA
RefactoringTry

813 of 931 branches covered (87.33%)

Branch coverage included in aggregate %.

56 of 63 new or added lines in 10 files covered. (88.89%)

21 existing lines in 3 files now uncovered.

4188 of 4411 relevant lines covered (94.94%)

0.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/sorm4j/src/main/java/org/nkjmlab/sorm4j/internal/util/function/ThrowableConsumer.java
1
package org.nkjmlab.sorm4j.internal.util.function;
2

3
import java.util.function.Consumer;
4

5
@FunctionalInterface
6
public interface ThrowableConsumer<T> {
7
  void accept(T t) throws Exception;
8

9
  /**
10
   * @param <T>
11
   * @param onTry
12
   * @param exceptionHandler
13
   * @return
14
   */
15
  public static <T> Consumer<T> toConsumer(
16
      ThrowableConsumer<T> onTry, Consumer<Exception> exceptionHandler) {
17
    return x -> {
1✔
18
      try {
19
        onTry.accept(x);
1✔
NEW
20
      } catch (Exception e) {
×
NEW
21
        exceptionHandler.accept(e);
×
22
      }
1✔
23
    };
1✔
24
  }
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc