Skip to content
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

Re-throw runtime errors when failing to parse 3D Tiles content. #6088

Merged
merged 6 commits into from
Jan 8, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Jan 4, 2018

Re-throws a RuntimeError in Cesium3DTileset when parsing content fails. Errors like 404s are still ignored.

@cesium-concierge
Copy link

Signed CLA is on file.

@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

Copy link
Contributor

@lilleyse lilleyse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work well. I edited a b3dm to be version 2 and got the error as expected.

Make sure to add a test. There are already tests that check for parsing errors but all of them are on the *Content level rather than the tileset level.

}).otherwise(removeFunction);
}).otherwise(function(error) {
removeFunction();
if (error instanceof RuntimeError) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also look for DeveloperError.

@lilleyse
Copy link
Contributor

lilleyse commented Jan 5, 2018

Fixes #5158. If it's not too much trouble could you also implement a tileFailed event like discussed there?

@bagnell
Copy link
Contributor Author

bagnell commented Jan 5, 2018

@lilleyse Updated and added a test.

Instead of throwing the error, an event is raised with the url and message. If there are no listeners, it logs the error to the console.

CHANGES.md Outdated
@@ -9,6 +9,7 @@ Change Log
* Improved CZML Custom Properties sandcastle example [#6086](https://github.com/AnalyticalGraphicsInc/cesium/pull/6086)
* Added `Plane.projectPointOntoPlane` for projecting a `Cartesian3` position onto a `Plane` [#6092](https://github.com/AnalyticalGraphicsInc/cesium/pull/6092)
* Added `Cartesian3.vectorProjection` for projecting one vector to another [#6093](https://github.com/AnalyticalGraphicsInc/cesium/pull/6093)
* Added `Cesium3DTileset.tileFailed` event that will be raised when a tile fails to load. The object passed to the event listener will have a url and message property. [#6088](https://github.com/AnalyticalGraphicsInc/cesium/pull/6088)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that if there are no listeners failed tile error messages will be logged to the console.

@lilleyse
Copy link
Contributor

lilleyse commented Jan 8, 2018

Besides that CHANGES.md comment this looks good.

@bagnell
Copy link
Contributor Author

bagnell commented Jan 8, 2018

@lilleyse Updated. Also updated the event doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants