Closed vinipsmaker closed 5 years ago
The following will fail on bad input:
void f(boost::string_view raw_result) { trial::dynamic::variable result; try { trial::protocol::json::iarchive archive(raw_result); archive >> result } catch (...) { // ... } }
The serialization code doesn't handle the trial::protocol::json::token::symbol::error enumeration:
trial::protocol::json::token::symbol::error
https://github.com/breese/trial.protocol/blob/e86adaf66b3847e12cee5affea4d643851e3f7b5/include/trial/protocol/json/serialization/dynamic/variable.hpp#L137
I have some hurry to solve this issue then I'll probably send a PR (after I solve the issue on my own tree). But which error handling do you think it fits into Trial.Protocol design? Is throwing an exception fine here?
Yes, exceptions are fine from the serialization
The following will fail on bad input:
The serialization code doesn't handle the
trial::protocol::json::token::symbol::error
enumeration:https://github.com/breese/trial.protocol/blob/e86adaf66b3847e12cee5affea4d643851e3f7b5/include/trial/protocol/json/serialization/dynamic/variable.hpp#L137
I have some hurry to solve this issue then I'll probably send a PR (after I solve the issue on my own tree). But which error handling do you think it fits into Trial.Protocol design? Is throwing an exception fine here?