Error codes and handling
veselov opened this issue · comments
Cool library, first of all.
However, I was browsing through the documentation and the API documentation, and I can't seem to find:
- exhaustive list of error codes that are defined
- methods returning errors don't specify which error codes they may return
- no
strerror
analogue
There are references to URI_ERROR_SYNTAX
, but that's sort of stray.
Is there any ongoing work to address this?
Hi Pawel,
for the list of error codes:
# git grep -Eoh 'URI_ERROR_[A-Z_]+' | sort -u
URI_ERROR_ADDBASE_REL_BASE
URI_ERROR_MALLOC
URI_ERROR_MEMORY_MANAGER_FAULTY
URI_ERROR_MEMORY_MANAGER_INCOMPLETE
URI_ERROR_NOT_IMPLEMENTED
URI_ERROR_NULL
URI_ERROR_OUTPUT_TOO_LARGE
URI_ERROR_RANGE_INVALID
URI_ERROR_REMOVEBASE_REL_BASE
URI_ERROR_REMOVEBASE_REL_SOURCE
URI_ERROR_SYNTAX
URI_ERROR_TOSTRING_TOO_LONG
Also this, not the comments:
uriparser/include/uriparser/UriBase.h
Lines 130 to 153 in 737e95f
I'd be open to do more in that regard, but you're the first to ask since project birth and it's not a priority. Would welcome a clean pull request.
Regarding strerror
: No plans and no need so far, would welcome a clean pull request.
URI_ERROR_SYNTAX
is accompanied by the precise error position. Classification might be possible, but would be quite some work to get fully covered and may break ABI compatibility. Not a good cost benefit ratio so far.
Best, Sebastian
Question seems answered — I'll close the ticket. Happy to re-open as needed.