Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 5 runtime/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ package(

java_library(
name = "runtime",
exports = ["//runtime/src/main/java/dev/cel/runtime"],
exports = [
"//runtime/src/main/java/dev/cel/runtime",
"//runtime/src/main/java/dev/cel/runtime:evaluation_exception",
],
)

java_library(
Expand Down
14 changes: 12 additions & 2 deletions 14 runtime/src/main/java/dev/cel/runtime/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ java_library(

# keep sorted
RUNTIME_SOURCES = [
"CelEvaluationException.java",
"CelFunctionOverload.java",
"CelFunctionResolver.java",
"CelLateFunctionBindings.java",
Expand All @@ -157,12 +156,24 @@ RUNTIME_SOURCES = [
"UnknownContext.java",
]

java_library(
name = "evaluation_exception",
srcs = ["CelEvaluationException.java"],
tags = [
],
deps = [
"//common",
"//common:error_codes",
],
)

java_library(
name = "runtime",
srcs = RUNTIME_SOURCES,
tags = [
],
deps = [
":evaluation_exception",
":evaluation_listener",
":runtime_helper",
":runtime_type_provider_legacy",
Expand All @@ -186,7 +197,6 @@ java_library(
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_protobuf_protobuf_java_util",
"@maven//:com_google_re2j_re2j",
"@maven//:org_jspecify_jspecify",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ public CelEvaluationException(String message, Throwable cause) {
super(formatErrorMessage(message), cause);
}

public CelEvaluationException(String message, Throwable cause, CelErrorCode errorCode) {
super(formatErrorMessage(message), cause, errorCode);
}

public CelEvaluationException(String message, CelErrorCode errorCode) {
super(formatErrorMessage(message), errorCode);
}

CelEvaluationException(InterpreterException cause, CelErrorCode errorCode) {
super(cause.getMessage(), cause.getCause(), errorCode);
public CelEvaluationException(String message, Throwable cause, CelErrorCode errorCode) {
this(message, cause, errorCode, true);
}

CelEvaluationException(
String message, Throwable cause, CelErrorCode errorCode, boolean formatErrorMessage) {
super(formatErrorMessage ? formatErrorMessage(message) : message, cause, errorCode);
}

private static String formatErrorMessage(String message) {
Expand Down
3 changes: 2 additions & 1 deletion 3 runtime/src/main/java/dev/cel/runtime/CelRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ private static CelEvaluationException unwrapOrCreateEvaluationException(
if (e.getCause() instanceof CelEvaluationException) {
return (CelEvaluationException) e.getCause();
}
return new CelEvaluationException(e, e.getErrorCode());

return new CelEvaluationException(e.getMessage(), e.getCause(), e.getErrorCode(), false);
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.