question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VRMLLoader does no error forwarding calling the parser

See original GitHub issue
Description of the problem

When an error occurs while parsing the loaded VRML file, the VRMLLoader does not handle it.

		load: function ( url, onLoad, onProgress, onError ) {

			var scope = this;

			var path = ( scope.path === '' ) ? LoaderUtils.extractUrlBase( url ) : scope.path;

			var loader = new FileLoader( this.manager );
			loader.setPath( scope.path );
			loader.load( url, function ( text ) {

				onLoad( scope.parse( text, path ) );

			}, onProgress, onError );

		},

It should call onError instead.

		load: function ( url, onLoad, onProgress, onError ) {

			var scope = this;

			var path = ( scope.path === '' ) ? LoaderUtils.extractUrlBase( url ) : scope.path;

			var loader = new FileLoader( this.manager );
			loader.setPath( scope.path );
			loader.load( url, function ( text ) {

			  try {
			    const parsed = scope.parse( text, path )
				  onLoad(parsed);

                         } catch (e) {
                            onError(e)
                       }

			}, onProgress, onError );

		},
Three.js version
  • r116
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, May 26, 2020

Okay, I’ve added today a PR with the fix.

1reaction
mrdoobcommented, May 22, 2020

I think loaders should use try/catch. It’s annoying when it bubbles up to the Editor’s Loader.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VRMLLoader from three.js error on Angular 6 project
Cannot set property 'undefined' of undefined" at VRMLLoader.parse() method. In my component I have the following code: import { VRMLLoader } ...
Read more >
VRMLLoader unable to load a VRML - Questions - three.js forum
I was trying to load a VRML loader through script but getting an error : Uncaught TypeError: THREE.VRMLLoader is not a constructor at...
Read more >
2005-January.txt - Kitware
The problem is when I want to run a minimal java example, by importing the jar ... using the standard VRML loader and...
Read more >
(PDF) A Collaborative Environment for Protein Visualization
We have developed a framework of distributed visualization and collaboration to help biochemistry and genomics researchers in understanding ...
Read more >
AVRA An Architecture for VR-Based Applications - uO Research
tightly hard coded within an architecture that does not welcome changes. ... their PPU is called NovodeX which is used by their Megon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found