Code review comment for lp:~zorba-coders/zorba/bug-867376

Revision history for this message
Luis Rodriguez Gonzalez (kuraru) wrote :

> As for the error condition, I've been thinking about it more, and I'm pretty
> sure that uri:serialize() needs to enforce at least the following rules:
>
> 1. You can specify opaque-part, OR some subset of host/port/path/user-
> info/query. Not both. (Put another way: If opaque-part is specified, then only
> scheme and fragment may be additionally be specified.)
>
> 2. If you specify opaque-part, scheme is required.
>
> 3. If you specify a scheme and a path, then the path MUST start with a /
> character.
>
> I would suggest introducing a zerr:ZURI0001 "malformed URI components" error
> message for uri:serialize() which is thrown if any of the above rules are
> broken, as well as some new test cases for each of them. It might be nice to
> have separate errors for each, I guess - ZURI0001 "cannot specify opaque-part
> in conjunction with host/port/path/user-info/query", ZURI0002 "scheme required
> when specifying opaque-part", and ZURI0003 "path component of absolute URI
> (ie, one with a scheme) must begin with /".

I will include the 3 different errors for uri:serialize(), Should I leave uri:parse() without any error code?
I see that in the previous function in the same module they use some predefined XQueryErrorCode inside diagnostic_list.h, Should I include my own codes there?

« Back to merge proposal