@inweb/viewer-visualize 27.1.1 → 27.1.3

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.
@@ -4220,10 +4220,8 @@ class Viewer extends EventEmitter2 {
4220
4220
  if (model && typeof model.database === "string") {
4221
4221
  file = model.file;
4222
4222
  }
4223
- if (!model)
4224
- throw new Error(`Format not supported`);
4225
4223
  let format = params.format;
4226
- if (!format && typeof file["type"] === "string")
4224
+ if (!format && file && typeof file["type"] === "string")
4227
4225
  format = file["type"].split(".").pop();
4228
4226
  if (!format && typeof file === "string")
4229
4227
  format = file.split(".").pop();
@@ -4231,7 +4229,7 @@ class Viewer extends EventEmitter2 {
4231
4229
  format = file.name.split(".").pop();
4232
4230
  const loader = loaders.createLoader(this, model, format);
4233
4231
  if (!loader)
4234
- throw new Error(`Format not supported`);
4232
+ throw new Error(`Format not supported (${format})`);
4235
4233
  this.loaders.push(loader);
4236
4234
  this.emitEvent({ type: "geometrystart", file, model });
4237
4235
  try {