madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
618 stars 41 forks source link

Improving behaviour to failed socket address parsing #176

Closed imag1ne closed 8 months ago

imag1ne commented 8 months ago

At present, a failure in parsing a socket address from a str results in a panic. Recognizing that constructing an I/O error with payload requires heap allocation and is thus costly, an error is still returned if a DNS lookup fails. It could be argued that returning an error in this scenario is a more preferable behavior than just panic, isn't it?