Commit ba3d7bd
authored
Avoid panics returning error instead (#509)
# Description
Improve robustness by replacing `.expect()` calls with proper error
handling in `opening.rs`.
Instead of panicking when `on_noise_channel_open()` or
`on_noise_channel_data()` fail, the errors are now logged and the
connection is gracefully closed by returning
`WebRtcEvent::ConnectionClosed`
Closes #350
Closes ChainSafe/gossamer-parity#771 parent 6d1e880 commit ba3d7bd
1 file changed
+21
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
| |||
428 | 435 | | |
429 | 436 | | |
430 | 437 | | |
431 | | - | |
432 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
433 | 450 | | |
434 | 451 | | |
435 | 452 | | |
| |||
0 commit comments