From 0fb5e5e068326b23493952619d7efb640cb37377 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Fri, 24 Aug 2012 21:22:20 +0300 Subject: Implement error messages in the decoder side. Update issue 7 Status: Started --- example/client.c | 2 +- example/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/client.c b/example/client.c index 9ad9c8c..edc8394 100644 --- a/example/client.c +++ b/example/client.c @@ -72,7 +72,7 @@ bool listdir(int fd, char *path) if (!pb_decode(&input, ListFilesResponse_fields, &response)) { - fprintf(stderr, "Decoding failed.\n"); + fprintf(stderr, "Decode failed: %s\n", PB_GET_ERROR(&input)); return false; } diff --git a/example/server.c b/example/server.c index 9f27906..346e9fb 100644 --- a/example/server.c +++ b/example/server.c @@ -55,7 +55,7 @@ void handle_connection(int connfd) if (!pb_decode(&input, ListFilesRequest_fields, &request)) { - printf("Decoding failed.\n"); + printf("Decode failed: %s\n", PB_GET_ERROR(&input)); return; } -- cgit 1.2.3-korg