tuxji commented on pull request #545:
URL: https://github.com/apache/daffodil/pull/545#issuecomment-830373479
I've looked at what would happen if we split error codes between libruntime
and libcli. It turns out that most of the existing error codes had been used
only in libcli too. We would end up with this split between libcli and
libruntime:
```c
// cli_errors.h - libcli
enum CliCode
{
CLI_FILE_CLOSE,
CLI_FILE_OPEN,
CLI_HELP_USAGE,
CLI_INVALID_COMMAND,
CLI_INVALID_INFOSET,
CLI_INVALID_OPTION,
CLI_MISSING_COMMAND,
CLI_MISSING_VALUE,
CLI_PROGRAM_ERROR,
CLI_PROGRAM_VERSION,
CLI_STACK_EMPTY,
CLI_STACK_OVERFLOW,
CLI_STACK_UNDERFLOW,
CLI_STRTOBOOL,
CLI_STRTOD_ERRNO,
CLI_STRTOI_ERRNO,
CLI_STRTONUM_EMPTY,
CLI_STRTONUM_NOT,
CLI_STRTONUM_RANGE,
CLI_UNEXPECTED_ARGUMENT,
CLI_XML_DECL,
CLI_XML_ELEMENT,
CLI_XML_ERD,
CLI_XML_GONE,
CLI_XML_INPUT,
CLI_XML_LEFT,
CLI_XML_MISMATCH,
CLI_XML_WRITE,
};
// errors.h - libruntime
enum ErrorCode
{
ERR_CHOICE_KEY,
ERR_FIXED_VALUE,
ERR_PARSE_BOOL,
ERR_STREAM_EOF,
ERR_STREAM_ERROR,
};
```
@mbeckerle and @stevedlawrence , do you still want the codes and messages to
be split up? I would end up duplicating enum CliCode and enum Error, struct
CliError and struct Error, and function cli_continue_or_exit and
continue_or_exit along with a couple of static functions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]