Skip to content

Commit 67a2605

Browse files
committed
Removing exception
1 parent 86afb71 commit 67a2605

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/main/java/com/yahoo/bullet/querying/Querier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ public void consume(BulletRecord record) {
449449
return;
450450
}
451451

452-
BulletRecord projected = project(record);
453452
try {
453+
BulletRecord projected = project(record);
454454
window.consume(projected);
455455
hasNewData = true;
456456
} catch (RuntimeException e) {

src/main/java/com/yahoo/bullet/querying/operations/ProjectionOperations.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ public static BulletRecord project(BulletRecord record, Projection projection, M
4242
for (Map.Entry<String, String> e : fields.entrySet()) {
4343
String field = e.getKey();
4444
String newName = e.getValue();
45-
try {
46-
if (field != null) {
47-
projected.forceSet(newName, record.extractField(field));
48-
}
49-
} catch (RuntimeException ignored) {
45+
if (field != null) {
46+
projected.forceSet(newName, record.extractField(field));
5047
}
5148
}
5249
return projected;

src/test/java/com/yahoo/bullet/querying/operations/ProjectionOperationsTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,12 @@ public void testNestedProjections() {
5959
Assert.assertEquals(actual, expected);
6060
}
6161

62-
@Test
62+
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Testing.*")
6363
public void testFailingProjection() {
6464
Projection projection = makeProjection(ImmutablePair.of("foo", "bar"));
6565
BulletRecord record = spy(RecordBox.get().add("foo", "123").getRecord());
6666
doThrow(new RuntimeException("Testing")).when(record).extractField(anyString());
67-
68-
BulletRecord actual = ProjectionOperations.project(record, projection, null, provider);
69-
BulletRecord expected = RecordBox.get().getRecord();
70-
Assert.assertEquals(actual, expected);
67+
ProjectionOperations.project(record, projection, null, provider);
7168
}
7269

7370
@Test

0 commit comments

Comments
 (0)