mirror of
https://github.com/servo/servo
synced 2026-05-12 09:56:50 +02:00
We should not be using `route_ipc_receiver_to_new_crossbeam_receiver` or similar methods, that `unwrap()` on the ROUTER thread if they encounter IPC errors. Instead, we now propagate the error to the crossbeam receiver. In the GenericChannel::Crossbeam case this means, that we need to use a `Result<T>` as the data type, even though the Result variant is always okay, so that the receiver type is the same regardless of `IPC` or not. This is required, so we have the same channel type, and can pass the inner crossbeam channel into e.g. `select!`, without having to wrap or re-implement select. This also means, that as we switch towards GenericChannel, we will gradually improve our error handling and eventually remove the existing panics on IPC errors. These changes were extracted out of https://github.com/servo/servo/pull/38782 Testing: Covered by existing tests. No new panics were introduced. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>