Implement error message support for the encoder side.
Update issue 7 Status: FixedInGit
This commit is contained in:
@@ -27,6 +27,7 @@ int main()
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Encoding failed: %s\n", PB_GET_ERROR(&stream));
|
||||
return 1; /* Failure */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,12 @@ int main()
|
||||
|
||||
/* Now encode it and check if we succeeded. */
|
||||
if (pb_encode(&stream, Person_fields, &person))
|
||||
{
|
||||
return 0; /* Success */
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Encoding failed: %s\n", PB_GET_ERROR(&stream));
|
||||
return 1; /* Failure */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Encoding failed!\n");
|
||||
fprintf(stderr, "Encoding failed: %s\n", PB_GET_ERROR(&stream));
|
||||
return 1; /* Failure */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user