Skip to content

Commit c3373ce

Browse files
cushoncopybara-github
authored andcommitted
Handle checked exceptions sneakily thrown by Kotlin in WorkRequestHandler
PiperOrigin-RevId: 824438783 Change-Id: I4316cb80c74b6a04236179a0bb7d6c8f6038405e
1 parent 5d90b19 commit c3373ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/google/devtools/build/lib/worker/WorkRequestHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ void startResponseThread(WorkerIO workerIO, WorkRequest request) {
471471
* #callback} are reported with exit code 1.
472472
*/
473473
@VisibleForTesting
474+
@SuppressWarnings("CatchingUnchecked") // handle checked exceptions thrown by Kotlin
474475
void respondToRequest(WorkerIO workerIO, WorkRequest request, RequestInfo requestInfo)
475476
throws IOException {
476477
int exitCode;
@@ -480,7 +481,7 @@ void respondToRequest(WorkerIO workerIO, WorkRequest request, RequestInfo reques
480481
exitCode = callback.apply(request, pw);
481482
} catch (InterruptedException e) {
482483
exitCode = 1;
483-
} catch (RuntimeException e) {
484+
} catch (Exception e) {
484485
e.printStackTrace(pw);
485486
exitCode = 1;
486487
}

0 commit comments

Comments
 (0)