Closed contfedorov closed 2 months ago
Hi there, I wanted to run some tests to make sure I could replicate with regards to an invalid API key - and I can, so it looks like you are right regarding the cause of the exception.
There are 2 things to mention: Firstly, agree that it isn't helpful not getting information about the API key in the error message. This is something we're working to improve in our next release. Right now with Beta 2, if load is called explicitly on loadable objects, such as layers, an exception is raised relating to the API key permissions. However in some cases, including in this sample for the service area task, loading is completed implicitly (as part of another operation / without a direct call to load). In our next release we are going to provide more error information in this scenario. So we expect this experience to improve.
With regards to handling exceptions - we try to strike a balance in our sample implementations between focusing on the key story of the area of API being demonstrated - the key classes, method calls, workflows etc. - and including everything you might see in a fully functioning application. That being said, we appreciate the feedback and will continue to bear this in mind with our sample implementations.
@jenmerritt Thanks for looking into this!
"Show service area" sample fails when I use my API key (copied from dev dashboard). It opens page with sample, renders UI, loads basemap, and shows spinner forever. But if I use OAuth token as an API key, it works well. Note: I don't set up OAuth, I just insert my OAuth token literally to the place where API key is expected to be.
Possibly, my API key does not have appropriate privileges. Nevertheless, app should handle this correctly and don't throw an exception.
I use:
Here is the stacktrace.