Error stringification?
Mango0x45 opened this issue · comments
It seems like some functions may or may not return error codes, but there doesn’t seem to be any kind of strerror()
-like function for turning those error codes into an actual error message. Would you guys be open to a PR adding a uriStrError()
function?
Hi @Mango0x45, I'm not sure I see value in adding a uriStrError
function. If I am not mistaken, the only two user-facing errors are URI_ERROR_SYNTAX
and URI_ERROR_MALLOC
and all else is bad use of the uriparser API by the application code. If that is a realistic assessment, no error text other than "mal-formed URI syntax with regard to RFC 3986" and "out of memory" or so would be needed. What am I missing?
Ah, are those the only two? From what I could tell from the docs and an early issue opened here, there were a lot more that had to be handled. In that case, I don’t think there’s any need :)
@Mango0x45 there are more but I don't see much more of end-user value:
uriparser/include/uriparser/UriBase.h
Lines 126 to 149 in e5d9381
I'll close this for now until there is a clear need for a function like that.