> In general, for most libraries I would recommend just manually creating error types and implementing the Error trait for them. If this is too complicated, consider why your API is throwing so many different kinds of errors, and whether your library is doing too many things.<p>It may not be obvious but this is a highly contrarian take at the moment. It's also probably the right approach in many cases.