Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tcf-dev] how to add custom errors in TCF agent?

 
Hi,
 
In the reference TCF agent code, I'm having trouble figuring out how to add a custom error reply, which isn't errno or a system error, without hand-coding a lot of json calls.
 
I.e. I'd like for a service to reply to a command with an error that has all the standard fields (timestamp, error code, format, provider, etc) but with a custom message.
 
It looks like errors.c potentially supports a range of custom error messages and some way to add content to it with ErrorReport/ErrorMessage structs.  But I wonder if I'm fooling myself, because ERR_MESSAGE_MIN/MAX and SRC_SYSTEM/GAI/MESSAGE/REPORT enums are only available inside errors.c, not in the header.
 
If I use "create_error_report()", which seems to be the API for this, how do I write the error object over json?  I.e. how can I combine what get_error_report() does with this?
 
-- Ed
 
 
 

Back to the top