When n1ql passes a request to the indexing service, and this fails, n1ql may have a need to return a specific error code.
For instance - if an index we are trying to create already exists, we should be returning a 4300.
We currently return 5000 (a general error) which is incorrect.
In order to do that - the only choice currently open to n1ql is to scan the indexing error string for keywords, which is inelegant, and less than ideal.
This could be solved if the indexing service could pass n1ql an integer error code alongside the error string.
n1ql conversely would provide a new NewIndexingError() error method, which the indexing client could call, so that n1ql could set the error appropriately.