2
0
Эх сурвалжийг харах

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.
Florian Van Belleghem 1 жил өмнө
parent
commit
ce72acd01c

+ 2 - 14
examples/jsm/loaders/USDZLoader.js

@@ -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.' );
 
 					}
 
@@ -242,12 +241,10 @@ class USDZLoader extends Loader {
 
 			if ( isCrate ) {
 
-				console.warn( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
+				throw Error( 'THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.' );
 
 			}
 
-			return undefined;
-
 		}
 
 		const zip = fflate.unzipSync( new Uint8Array( buffer ) );
@@ -260,15 +257,6 @@ class USDZLoader extends Loader {
 
 		const file = findUSD( zip );
 
-		if ( file === undefined ) {
-
-			console.warn( 'THREE.USDZLoader: No usda file found.' );
-
-			return new Group();
-
-		}
-
-
 		// Parse file
 
 		const text = fflate.strFromU8( file );