logoalt Hacker News

sheepttoday at 3:08 AM1 replyview on HN

A Rust library likely wouldn't be returning an opaque Box<dyn Error> to begin with. Errors are part of a library's API—it's what allows consumers to handle them—so you'd define an enum of possible errors your library could produce and return that, which would be stored on the stack.


Replies

dnauticstoday at 3:32 AM

What about the data in the error payload?

show 2 replies