Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support error reporting from serialization (binary & JSON) #65

Closed
tribal-tec opened this issue Nov 21, 2016 · 0 comments
Closed

Support error reporting from serialization (binary & JSON) #65

tribal-tec opened this issue Nov 21, 2016 · 0 comments

Comments

@tribal-tec
Copy link
Contributor

Requires changes on the SerializeCallback and DeserializeCallback to have either return values or in-out parameters with enum for error code and an optional error message. This way, applications can add error reporting that is eventually transported to an HTTP client for instance.

namespace servus
{

...

// in the spirit of HTTP status codes
enum class Status
{
    OK,
    BAD_REQUEST,
    ...
}

struct Response
{
    Status status = OK;
    std::string message;
}

typedef std::function< void( Response& ) > DeserializedCallback;
typedef std::function< void( Response& ) > SerializeCallback;

}
@tribal-tec tribal-tec mentioned this issue Nov 22, 2016
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant