-
Notifications
You must be signed in to change notification settings - Fork 100
More fine grained exceptions #50
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
Comments
Hello @devrck! That would be really great !! 😄 Can you quickly explain here what kind of errors you want to add? Like a list of the new exceptions? 🙂 FYI: we thought about renaming |
Hi @curquiza, What i wanted to propose is to create more than the 3, but of course I can extend from there. For example you say <?php
namespace MeiliSearch\Exceptions;
class InvalidFacetFilter extends ApiException {
// ...
} The only issue I see now is the 3 errors detailed in meilisearch/integration-guides#19 are maybe conflicting because for example Maybe we can start with the list from here https://github.com/meilisearch/MeiliSearch/blob/master/meilisearch-error/src/lib.rs#L87 and put them in categories. What do you think? |
Seems perfect! 😄
I think we were not really clear in our issue, sorry. I don't think it will be conflicting. The
There are already in categories 😉 When the MeiliSearch API returns an error, there is a FYI, but not specifically useful for development:
|
143: Rename MeiliSearch\HTTPRequestException into MeiliSearch\ApiException r=bidoubiwa a=claudiunicolaa Rename `MeiliSearch\HTTPRequestException` into `MeiliSearch\ApiException` Explained here meilisearch/integration-guides#19 and discussed here #50. I hope I understood correctly your intention 😃 Co-authored-by: Claudiu Nicola <[email protected]>
hi @curquiza,
What do you think is the best to do with |
Hum I don't know, it is currently used in the package. Do you think about better error handling? |
I guess will be easier to maintain the SDK if the errors are passed from MeiliSearch API directly to the client. From the above-quoted message, my understanding was that |
You're right, they share the same purpose 🙂 MeiliSearch returns well-detailed errors, with a link to the docs, see the docs. However, currently the interpreter does not display all the information when raising an exception: You can only get the message and the HTTP code error but not the link to the docs, and the |
wdyt about this format?
|
Seems great! Do you want to open a PR? 🙂 Or do you want me to fix it instead? |
150: Add more details MeiliSearch\Exceptions\ApiException r=bidoubiwa a=claudiunicolaa Discussed here #50 Co-authored-by: claudiunicolaa <[email protected]>
Does #150 resolves this issue? |
Yes! :) |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
The current implementation of
HTTPRequestException
is to vague and of course allows you to build on it but maybe it's nice to have the more fine grained exceptions already in the package https://github.com/meilisearch/MeiliSearch/blob/master/meilisearch-core/src/error.rs, https://github.com/meilisearch/MeiliSearch/blob/master/meilisearch-error/src/lib.rs .Wanted to start with this contribution but wanted first to ask you guys if that is ok and if you agree with it?
The text was updated successfully, but these errors were encountered: