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

Error reporting in re #108

Closed
rkd-msw opened this issue Jan 18, 2018 · 1 comment
Closed

Error reporting in re #108

rkd-msw opened this issue Jan 18, 2018 · 1 comment

Comments

@rkd-msw
Copy link

rkd-msw commented Jan 18, 2018

In my re application, I've just been tracking down an ETIMEDOUT error - which I wrongly assumed was a TCP connection timeout, until I realised it actually represented a SIP transaction timeout (from https://github.com/creytiv/re/blob/master/src/sip/ctrans.c#L174).

I'd like to make this easier to diagnose, including viewing the Call-ID etc. of the message I tried to send, but I'm not sure how:

  • some kind of logging callback infrastructure, so I can register an error log handler with re?
  • just printing the error to stderr?
  • using the DEBUG_WARNING macro?
  • implementing re-specific error codes, and an re_strerror, so I can return E_RE_SIPCXNTIMEOUT instead of ETIMEDOUT?
@alfredh
Copy link
Contributor

alfredh commented Feb 12, 2018

thanks for your comment

the logging in libre is a bit mixed; some modules are using DEBUG_XXX macros,
some modules are using printing to stderr, some module have no logging.

the most practical is to use DEBUG_XXX which has a callback handler
to the application for log messages.

adding re-specific error codes is possible, since we are using the
format specified %m for errno-types of error codes.

e.g.: re_printf("%m\n", EINVAL);

Alfred

@alfredh alfredh closed this as completed Mar 19, 2018
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

2 participants