|
@@ -14,7 +14,16 @@ export class B3DMLoaderBase {
|
|
|
load( url ) {
|
|
|
|
|
|
return fetch( url, this.fetchOptions )
|
|
|
- .then( res => res.arrayBuffer() )
|
|
|
+ .then( res => {
|
|
|
+
|
|
|
+ if ( ! res.ok ) {
|
|
|
+
|
|
|
+ throw new Error( `Failed to load file "${ url }" with status ${ res.status } : ${ res.statusText }` );
|
|
|
+
|
|
|
+ }
|
|
|
+ return res.arrayBuffer();
|
|
|
+
|
|
|
+ } )
|
|
|
.then( buffer => this.parse( buffer ) );
|
|
|
|
|
|
}
|