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

USDZLoader: throw error instead of warning #28685

Merged
merged 1 commit into from
Jun 18, 2024
Merged

USDZLoader: throw error instead of warning #28685

merged 1 commit into from
Jun 18, 2024

Conversation

zaesur
Copy link
Contributor

@zaesur zaesur commented Jun 17, 2024

Fixed #28684

Description

USDZLoader should throw an error instead of the warning, to allow the consumer to act upon the error. This PR changes the console warnings to throw errors, and removes the block that returns an empty group when findUSD returns undefined.

USDZLoader should throw an error instead of the warning, to allow the
consumer to act upon the error.
@Mugen87 Mugen87 added this to the r166 milestone Jun 17, 2024
@@ -182,8 +182,7 @@ class USDZLoader extends Loader {

if ( isCrateFile( zip[ filename ] ) ) {

console.warn( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
continue;
throw Error( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I think throwing an error is indeed more helpful than just logging a warning. In this way, the app can better handle the situation.

@mrdoob mrdoob merged commit ce72acd into mrdoob:dev Jun 18, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants