CACI-International / ergo

The ergo language and runtime.
MIT License
2 stars 2 forks source link

Hilariously long error from `std:net:unarchive` #19

Open calebzulawski opened 1 year ago

calebzulawski commented 1 year ago
error: error: error: request or response body error: error reading a body from connection: protocol error: unspecific protocol error detected

I'm sure each of these layers of error probably means something, in this scenario it doesn't matter so much but maybe something like anyhow's error contexts could be used to nest errors more ergonomically

afranchuk commented 1 year ago

I think that may be a result of round-tripping in the error type. ergo_runtime::Error has a Display which looks like error: <message>, and if that error has to be converted to Box<dyn std::error::Error> to pass through an external library then that's basically what would end up happening. Internally ergo_runtime::Error can accommodate nested errors and context nicely.