Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k
stars
93
forks
source link
Transformers in easy_parser should have an ability to fail #99
In the versions up to 0.6.8 transformers in RESTinio's easy_parser has the following format:
Output_Type transformer(Input_Type &&)
where Output_Type can't have and error indication. For example, there could be a transformer:
int to_integer(std::string && from)
and the only way to indicate a conversion failure is to throw an exception.
This is not good. In some cases, it's required to have an ability to return an error description from the transformer. So a transformer should have the following format:
In the versions up to 0.6.8 transformers in RESTinio's easy_parser has the following format:
where
Output_Type
can't have and error indication. For example, there could be a transformer:and the only way to indicate a conversion failure is to throw an exception.
This is not good. In some cases, it's required to have an ability to return an error description from the transformer. So a transformer should have the following format: