Skip to content

Commit

Permalink
EventSource: avoid rethrowing moved-from exception
Browse files Browse the repository at this point in the history
`kj::getCaughtExceptionAsKj()` can move data out of the caught exception, so
rethrowing it can result in exceptions with missing data.
  • Loading branch information
jclee committed Oct 23, 2024
1 parent 86df46f commit ccdb5a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/workerd/api/eventsource.c++
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ kj::Promise<void> processBody(IoContext& context, kj::Promise<DeferredProxy<void
co_return;
}
// Propagate the exception up.
throw;
kj::throwFatalException(kj::mv(ex));
}
}
} // namespace
Expand Down

0 comments on commit ccdb5a9

Please sign in to comment.