I wouldn’t do anything like that, unless:
- it was something I needed really badly (this is not often the case)
- it would be more work to write from scratch, than it would be to provide a fork with proper errors and then maintain that fork (which is a bad idea for the longer term).
But even if I decided to write a patch, there’s a large probability that the PR wouldn’t be accepted, or else it would be the maintainer essentially admitting that stringly typed errors were a suboptimal choice (in which case they should have done something about it themselves, or better yet, they shouldn’t have used stringly typed errors at all).
Besides, it is not the community’s responsibility to fix design flaws in dependencies.
You seem to contradict yourself here. You argue in favor of stringly typed errors, yet you readily admit it’s an absolute disaster in Go.
Aside from that, is that really what you think will happen, especially if the poorer option seems easier to use at the beginning than the proper one? I think that experienced Rustaceans will know not to touch stringly typed errors with a 10 foot pole, but as the Rust Survey 2018 makes clear, most Rustaceans (rougly 75%) are not all that experienced with Rust at this time (i.e. that 75% has < 2 years of experience with the language).
Therefore, the better assumption is that inexperienced users will go for the easier-seeming option, which leads to “error handling” similar to the Go example above.
It’s a mistake to think others think like you yourself do. In fact, the larger the population, the more solutions to a given problem look like a local search / evolutionary process: all options are tried at some point or another.
Of course at some point consensus might be formed, but by that time the damage is done, and we have a bunch of nigh-unusable crates.
Agreed, that’s one of the reasons I’m arguing against stringly typed errors.
It fails to convince me, so no.
The ALSA example above is a bad one BTW: ALSA is notorious for its poor code quality, to the point that PulseAudio needed to paper over its bugs to some extent.
The TOML example equally fails to convince me: just because you happen not to do error recovery doesn’t mean it should be hard to do or even impossible there. Quite the opposite in fact: A flexible software design is a good design (flexibility being defined as an ability to react to previously-unexpected demands from new use cases).
As for the 3rd example i.e. an alternative to panic!: there already is one. It’s the enum-based error system we already have.
What I suspect you’re really arguing is that you find it too much work to properly design and implement enum errors (optionally enhanced by std::error::Error or failure::Fail). If that’s indeed the case then that I can understand. But the solution to that is decidedly not stringly typed errors.