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

leeonky / test-charm-java / 212

14 Apr 2025 05:15AM UTC coverage: 74.088% (-0.1%) from 74.209%
212

push

circleci

leeonky
Update version

7957 of 10740 relevant lines covered (74.09%)

0.74 hits per line

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

70.59
/DAL-java/src/main/java/com/github/leeonky/dal/runtime/ExpressionException.java
1
package com.github.leeonky.dal.runtime;
2

3
import com.github.leeonky.dal.ast.node.DALExpression;
4
import com.github.leeonky.interpreter.InterpreterException;
5

6
import java.util.function.Function;
7
import java.util.function.Supplier;
8

9
public abstract class ExpressionException extends java.lang.RuntimeException {
1✔
10
    public static <T> T opt1(Supplier<T> supplier) {
11
        try {
12
            return supplier.get();
1✔
13
        } catch (InterpreterException e) {
×
14
            throw e;
×
15
        } catch (Exception e) {
1✔
16
            throw exception(expression -> new DalException(expression.left().getOperandPosition(), e));
1✔
17
        }
18
    }
19

20
    public static <T> T opt2(Supplier<T> supplier) {
21
        try {
22
            return supplier.get();
1✔
23
        } catch (InterpreterException e) {
×
24
            throw e;
×
25
        } catch (Exception e) {
1✔
26
            throw exception(expression -> new DalException(expression.right().getOperandPosition(), e));
1✔
27
        }
28
    }
29

30
    public java.lang.RuntimeException rethrow(DALExpression expression) {
31
        return thrower(expression);
1✔
32
    }
33

34
    abstract protected java.lang.RuntimeException thrower(DALExpression expression);
35

36
    public static ExpressionException exception(Function<DALExpression, java.lang.RuntimeException> thrower) {
37
        return new ExpressionException() {
1✔
38
            @Override
39
            protected java.lang.RuntimeException thrower(DALExpression expression) {
40
                return thrower.apply(expression);
1✔
41
            }
42
        };
43
    }
44

45
    public static ExpressionException illegalOperation(String message) {
46
        return exception(expression -> new DalException(message, expression.operator().getPosition()));
1✔
47
    }
48

49
    public static ExpressionException illegalOp2(String message) {
50
        return exception(expression -> new DalException(message, expression.right().getOperandPosition()));
1✔
51
    }
52

53
    public static ExpressionException illegalOp1(String message) {
54
        return exception(expression -> new DalException(message, expression.left().getOperandPosition()));
×
55
    }
56
}
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