Skip to content

Commit ce72acd

Browse files
authored
USDZLoader: throw error instead of warning (#28684) (#28685)
USDZLoader should throw an error instead of the warning, to allow the consumer to act upon the error.
1 parent 852b1f5 commit ce72acd

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

examples/jsm/loaders/USDZLoader.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ class USDZLoader extends Loader {
182182

183183
if ( isCrateFile( zip[ filename ] ) ) {
184184

185-
console.warn( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
186-
continue;
185+
throw Error( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
187186

188187
}
189188

@@ -242,12 +241,10 @@ class USDZLoader extends Loader {
242241

243242
if ( isCrate ) {
244243

245-
console.warn( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
244+
throw Error( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
246245

247246
}
248247

249-
return undefined;
250-
251248
}
252249

253250
const zip = fflate.unzipSync( new Uint8Array( buffer ) );
@@ -260,15 +257,6 @@ class USDZLoader extends Loader {
260257

261258
const file = findUSD( zip );
262259

263-
if ( file === undefined ) {
264-
265-
console.warn( 'THREE.USDZLoader: No usda file found.' );
266-
267-
return new Group();
268-
269-
}
270-
271-
272260
// Parse file
273261

274262
const text = fflate.strFromU8( file );

0 commit comments

Comments
 (0)