@galacean/engine-loader 0.9.19 → 0.9.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2524,8 +2524,14 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2524
2524
  }
2525
2525
  });
2526
2526
  GLTFParser.defaultPipeline.parse(context).then(masterPromiseInfo.resolve).catch(function(e) {
2527
- console.error(e);
2528
- masterPromiseInfo.reject("Error loading glTF model from " + url + " .");
2527
+ var msg = "Error loading glTF model from " + url + " .";
2528
+ miniprogram.Logger.error(msg);
2529
+ masterPromiseInfo.reject(msg);
2530
+ context.defaultSceneRootPromiseInfo.reject(e);
2531
+ context.texturesPromiseInfo.reject(e);
2532
+ context.materialsPromiseInfo.reject(e);
2533
+ context.meshesPromiseInfo.reject(e);
2534
+ context.animationClipsPromiseInfo.reject(e);
2529
2535
  });
2530
2536
  return context.promiseMap;
2531
2537
  };
@@ -4083,7 +4089,7 @@ exports.MeshLoader = /*#__PURE__*/ function(Loader) {
4083
4089
  decode(data, resourceManager.engine).then(function(mesh) {
4084
4090
  resolve(mesh);
4085
4091
  });
4086
- });
4092
+ }).catch(reject);
4087
4093
  });
4088
4094
  };
4089
4095
  return MeshLoader;
@@ -4102,14 +4108,14 @@ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
4102
4108
  var _proto = EditorTextureLoader.prototype;
4103
4109
  _proto.load = function load(item, resourceManager) {
4104
4110
  var _this = this;
4105
- return new miniprogram.AssetPromise(function(resolve) {
4111
+ return new miniprogram.AssetPromise(function(resolve, reject) {
4106
4112
  _this.request(item.url, {
4107
4113
  type: "arraybuffer"
4108
4114
  }).then(function(data) {
4109
4115
  decode(data, resourceManager.engine).then(function(texture) {
4110
4116
  resolve(texture);
4111
4117
  });
4112
- });
4118
+ }).catch(reject);
4113
4119
  });
4114
4120
  };
4115
4121
  return EditorTextureLoader;
package/dist/module.js CHANGED
@@ -2519,8 +2519,14 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
2519
2519
  }
2520
2520
  });
2521
2521
  GLTFParser.defaultPipeline.parse(context).then(masterPromiseInfo.resolve).catch(function(e) {
2522
- console.error(e);
2523
- masterPromiseInfo.reject("Error loading glTF model from " + url + " .");
2522
+ var msg = "Error loading glTF model from " + url + " .";
2523
+ Logger.error(msg);
2524
+ masterPromiseInfo.reject(msg);
2525
+ context.defaultSceneRootPromiseInfo.reject(e);
2526
+ context.texturesPromiseInfo.reject(e);
2527
+ context.materialsPromiseInfo.reject(e);
2528
+ context.meshesPromiseInfo.reject(e);
2529
+ context.animationClipsPromiseInfo.reject(e);
2524
2530
  });
2525
2531
  return context.promiseMap;
2526
2532
  };
@@ -4078,7 +4084,7 @@ var MeshLoader$1 = /*#__PURE__*/ function(Loader) {
4078
4084
  decode(data, resourceManager.engine).then(function(mesh) {
4079
4085
  resolve(mesh);
4080
4086
  });
4081
- });
4087
+ }).catch(reject);
4082
4088
  });
4083
4089
  };
4084
4090
  return MeshLoader;
@@ -4097,14 +4103,14 @@ var EditorTextureLoader = /*#__PURE__*/ function(Loader) {
4097
4103
  var _proto = EditorTextureLoader.prototype;
4098
4104
  _proto.load = function load(item, resourceManager) {
4099
4105
  var _this = this;
4100
- return new AssetPromise(function(resolve) {
4106
+ return new AssetPromise(function(resolve, reject) {
4101
4107
  _this.request(item.url, {
4102
4108
  type: "arraybuffer"
4103
4109
  }).then(function(data) {
4104
4110
  decode(data, resourceManager.engine).then(function(texture) {
4105
4111
  resolve(texture);
4106
4112
  });
4107
- });
4113
+ }).catch(reject);
4108
4114
  });
4109
4115
  };
4110
4116
  return EditorTextureLoader;