Skip to content

Commit e966e90

Browse files
l46kokcopybara-github
authored andcommitted
Migrate the runtime to use canonical CEL exception classes
PiperOrigin-RevId: 852421357
1 parent bee8115 commit e966e90

File tree

55 files changed

+226
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+226
-362
lines changed

common/BUILD.bazel

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ java_library(
5353
exports = ["//common/src/main/java/dev/cel/common:mutable_source"],
5454
)
5555

56-
java_library(
57-
name = "runtime_exception",
58-
# used_by_android
59-
visibility = ["//:internal"],
60-
exports = ["//common/src/main/java/dev/cel/common:runtime_exception"],
61-
)
62-
6356
java_library(
6457
name = "proto_json_adapter",
6558
exports = ["//common/src/main/java/dev/cel/common:proto_json_adapter"],

common/exceptions/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ package(
55
default_visibility = ["//:internal"],
66
)
77

8+
java_library(
9+
name = "runtime_exception",
10+
# used_by_android
11+
exports = ["//common/src/main/java/dev/cel/common/exceptions:runtime_exception"],
12+
)
13+
814
java_library(
915
name = "attribute_not_found",
1016
# used_by_android

common/src/main/java/dev/cel/common/BUILD.bazel

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ java_library(
172172
],
173173
)
174174

175-
java_library(
176-
name = "runtime_exception",
177-
srcs = ["CelRuntimeException.java"],
178-
# used_by_android
179-
tags = [
180-
],
181-
deps = [
182-
":error_codes",
183-
"//common/annotations",
184-
],
185-
)
186-
187175
java_library(
188176
name = "mutable_ast",
189177
srcs = ["CelMutableAst.java"],

common/src/main/java/dev/cel/common/exceptions/BUILD.bazel

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,27 @@ package(
88
],
99
)
1010

11+
java_library(
12+
name = "runtime_exception",
13+
srcs = ["CelRuntimeException.java"],
14+
# used_by_android
15+
tags = [
16+
],
17+
deps = [
18+
"//common:error_codes",
19+
"//common/annotations",
20+
],
21+
)
22+
1123
java_library(
1224
name = "attribute_not_found",
1325
srcs = ["CelAttributeNotFoundException.java"],
1426
# used_by_android
1527
tags = [
1628
],
1729
deps = [
30+
":runtime_exception",
1831
"//common:error_codes",
19-
"//common:runtime_exception",
2032
"//common/annotations",
2133
],
2234
)
@@ -28,8 +40,8 @@ java_library(
2840
tags = [
2941
],
3042
deps = [
43+
":runtime_exception",
3144
"//common:error_codes",
32-
"//common:runtime_exception",
3345
"//common/annotations",
3446
],
3547
)
@@ -41,8 +53,8 @@ java_library(
4153
tags = [
4254
],
4355
deps = [
56+
":runtime_exception",
4457
"//common:error_codes",
45-
"//common:runtime_exception",
4658
"//common/annotations",
4759
],
4860
)
@@ -54,8 +66,8 @@ java_library(
5466
tags = [
5567
],
5668
deps = [
69+
":runtime_exception",
5770
"//common:error_codes",
58-
"//common:runtime_exception",
5971
"//common/annotations",
6072
],
6173
)
@@ -67,8 +79,8 @@ java_library(
6779
tags = [
6880
],
6981
deps = [
82+
":runtime_exception",
7083
"//common:error_codes",
71-
"//common:runtime_exception",
7284
"//common/annotations",
7385
],
7486
)
@@ -80,8 +92,8 @@ java_library(
8092
tags = [
8193
],
8294
deps = [
95+
":runtime_exception",
8396
"//common:error_codes",
84-
"//common:runtime_exception",
8597
"//common/annotations",
8698
],
8799
)
@@ -93,8 +105,8 @@ java_library(
93105
tags = [
94106
],
95107
deps = [
108+
":runtime_exception",
96109
"//common:error_codes",
97-
"//common:runtime_exception",
98110
"//common/annotations",
99111
],
100112
)

common/src/main/java/dev/cel/common/exceptions/CelAttributeNotFoundException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019
import java.util.Arrays;
2120
import java.util.Collection;

common/src/main/java/dev/cel/common/exceptions/CelBadFormatException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019

2120
/** Indicates that a data conversion failed due to a mismatch in the format specification. */

common/src/main/java/dev/cel/common/exceptions/CelDivideByZeroException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019

2120
/** Indicates that a division by zero occurred. */

common/src/main/java/dev/cel/common/exceptions/CelIndexOutOfBoundsException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019

2120
/** Indicates that a list index access was attempted using an index that is out of bounds. */

common/src/main/java/dev/cel/common/exceptions/CelInvalidArgumentException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019

2120
/** Indicates that an invalid argument was supplied to a function. */

common/src/main/java/dev/cel/common/exceptions/CelIterationLimitExceededException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package dev.cel.common.exceptions;
1616

1717
import dev.cel.common.CelErrorCode;
18-
import dev.cel.common.CelRuntimeException;
1918
import dev.cel.common.annotations.Internal;
2019
import java.util.Locale;
2120

0 commit comments

Comments
 (0)