Skip to content

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

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
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.

USDZLoader: loading a binary file does not throw error

3 participants