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.

Override Error.handler for UnityLoader

See original GitHub issue

Hi,

First of all thanks for this component, I’ve been using it without any problems for my game. I have a feature request. Would it be possible to override the Error.handler function on the UnityLoader object?

As described in this thread: https://forum.unity.com/threads/make-javascript-errors-not-alert-in-5-6.466772/

I’ve tried to edit the source in Unity.ts here: this.unityContent.setUnityInstance(UnityLoader.instantiate( ReactUnityWebGL${this.props.unityContent.uniqueID}_, this.props.unityContent.buildJsonPath, { onProgress: this.onProgress.bind(this), Module: this.props.unityContent.unityConfig.modules, width: "100%", height: "100%" })); }

But UnityLoader has no Error object here and I have zero experience in TypeScript myself. Would this be hard to implement?

Thanks.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bartofzocommented, Jun 11, 2019

Looks good! The error handler has 2 parameters though, the second I believe is module. I’m not using it but maybe it would be good to include it in your definition for people that want to use it.

0reactions
jeffreylanterscommented, Jun 11, 2019

Thanks! I’ll add it later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Override Error.handler for UnityLoader · Issue #64 - GitHub
I have a feature request. Would it be possible to override the Error.handler function on the UnityLoader object? ... But UnityLoader has no...
Read more >
Is it possible to catch out of memory errors on WebGL
You can override the UnityLoader Error callback - it doesn't look like it has actual different event ... Error.handler = function(e, t).
Read more >
Buttons sample Unity WebGL error - Forums - NoesisGUI
UnityLoader.js:4 OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level <OpenGL ES 3.0> ; Context handle 1
Read more >
How can I solve this error in WebGL Unity game?
1. In Unity. Make sure to updated Unity. The last version seems to handle this better. Allocate more memory. In our specific use- ......
Read more >
Using WebGL Templates - Unity - Manual
UnityLoader.instantiate(container, url, override). UnityLoader.instantiate is responsible for creating a new instance of your content.
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