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
Unhandled exception causes fatal error when API secret isn't set #20
Comments
@jslegers can you create a PR for this if this is still an issue? |
@carakas : I no longer have a working Teamleader account nor any interest in using this library. Heck, I haven't even been doing any PHP coding in months ;-) |
Ok then I'll close this issue |
@carakas : Shouldn't you first test whether you can reproduce the error before you close the issue? |
@jslegers they are constructor parameters, so in my opinion we can expect them to be there |
@carakas : After your initial setup, yes, you can expect them to be there. A lot can go wrong during the initial setup, however, and useful help messages at this stage would make everyone's lives easier ;-) |
I'll reopen it |
I still don't see how this could happen, since the initial setup is literally passing those values to the constructor |
It doesn't seem like the teamleader API lets us know that an authentication error occured? In that case, displaying the error they return is the only thing we can do... The only thing they let us know is:
which aren't even great http response codes (see their api docs ) Furthermore, we can't check for correctness of the parameters when constructing the instance, so it seems to me like throwing an exception like this is the only reasonable way to go? |
@carakas : This error takes place when there's a mistake in your API secret or API group. As I explained (in the first line), it happened to me due to a typo that was anything but obvious to spot :
|
Because I had a typo in the field name referencing my API secret, I get the following fatal error:
It would be nice to trigger a more user friendly error message when an API secret or API group has not been defined instead of this error.
The text was updated successfully, but these errors were encountered: