zincjs 1.13.1 → 1.13.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zincjs",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
@@ -92,10 +92,18 @@ Object.assign( JSONLoader.prototype, {
92
92
  }
93
93
 
94
94
  if (scope && scope.parse) {
95
- var object = scope.parse( json, texturePath );
96
- onLoad( object.geometry, object.materials );
97
- }
98
-
95
+ try {
96
+ var object = scope.parse( json, texturePath );
97
+ onLoad( object.geometry, object.materials );
98
+ } catch (e) {
99
+ console.error("The loader has encountered aon loading the geometry");
100
+ console.error(e);
101
+ if (onError) {
102
+ onError({responseURL: url});
103
+ return;
104
+ }
105
+ }
106
+ }
99
107
  }, onProgress, onError );
100
108
 
101
109
  },
@@ -60,7 +60,7 @@ exports.SceneLoader = function (sceneIn) {
60
60
  return xhr => {
61
61
  this.toBeDownloaded = this.toBeDownloaded - 1;
62
62
  errorDownload = true;
63
- console.error(`There is an issue with external resource: ${xhr?.responseURL}.`);
63
+ console.error(`There is an issue with external resource ${xhr?.responseURL ? ": " + xhr?.responseURL: ""}.`);
64
64
  const payload = {
65
65
  type: "Error",
66
66
  xhr
@@ -122,7 +122,7 @@ exports.SceneLoader = function (sceneIn) {
122
122
  if (finishCallback != undefined && (typeof finishCallback == 'function'))
123
123
  finishCallback();
124
124
  } else {
125
- this.onError();
125
+ (this.onError(finishCallback))({responseURL: url});
126
126
  }
127
127
  }
128
128
  }