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.

PCDLoader does not handle errors correctly

See original GitHub issue
Description of the problem

The PCDLoader doesn’t handle errors well. If there’s an error when parsing, the error handler passed in is not called and the resulting exception is only caught by a global process handler. This may apply to all loaders as if there’s an error in the setTimeout method used for loading there’s no way to catch that exception.

        var url = 'https://threejs.org/examples/textures/sprites/disc.png';
        var loader = new THREE.PCDLoader().load(
          url, 
          () => alert('something loaded'),
          () => {},
          () => alert('error handler - never gets called')
        );
Three.js version
  • r91
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

any

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
elcommiecommented, Aug 27, 2018

Sure. Why not? I’ll get something up later today

1reaction
Mugen87commented, Aug 25, 2018

Maybe something like this would help to improve error handling:

try {

    onLoad( scope.parse( data, url ) );

} catch ( e ) {

    if ( onError ) onError( e );

}

The onError() callback of PCDLoader.load() would now be able to handle exceptions caused by an invalid format.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load a pcd file using a get request from node server ...
Inside the javascript code using pcd loader tried to load the point cloud inside the scene. var loader = new THREE.PCDLoader() // load...
Read more >
A Definitive Guide to Handling Errors in JavaScript - Kinsta
Getting tripped up by errors in your JavaScript? We'll show you how to tame those errors so you can get back to developing...
Read more >
PCDLoader – three.js docs
PCDLoader. A loader for the PCD (Point Cloud Data) file format. PCDLoader supports ASCII and (compressed) binary files as well as the following...
Read more >
Error Handling - loaders.gl
Applications typically want to provide solid error handling when loading and ... At the moment loaders.gl does not provide any error formatting plugins, ......
Read more >
Changelog for package hrpsys - ROS Documentation
... Add KalmanFilterParam as struct; Better error handling ... controller does not work due to some fault of input. d3a7750 (rtc/PCDLoader) ...
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