forked from mapbox/mapbox-gl-js
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fire an error on checking if non-existant source is loaded mapbox#3691
- Loading branch information
1 parent
f9f1a82
commit 3ac76b0
Showing
2 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3ac76b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the heck do you throw an Error if the source is non existant? Why wouldn't you just return false??? That method can be called for different reasons, one of them being not every source is loaded all the time, so the sane thing to do would be just to return false. How else are you supposed to find out if a source you sometimes add, but not always, is really loaded?