Suppressing the "red screen of error" for external JavaScript libraries

I am using an external javascript library (not by me) that has semi-frequent errors. The errors don’t impact the functioning of the wiki, nor cause data loss. I’m including the library in a $:/tags/RawMarkup tiddler that just uses <script> tags.

Is there any way to catch / suppress these before they get to TiddlyWiki’s “red screen of error” handling? I’m worried that would be confusing for users. I don’t want to globally disable the “red screen of error”, as there may be legitimate errors thrown by the wiki.

It may depend on the library

you could maybe try with

try {
//include lib here
} catch (e ) {}

errors can occur because the library is downloading something (or itself) from the internet and the tiddlywiki js calls the lib too early, before it has finished loading.

Thanks @buggyj. I came up with a slightly hacky WikiText only solution, leaving it here for others that may want it:

  1. Make a new tiddler with this in its text:
.tc-error-form { display: none;}
  1. Tag it $:/tags/Stylesheet

This is a major hack and may lead to data loss, but works for my purposes. The errors are left in the DOM in case you need to inspect them.

Did you try to tell them, that there is a problem?

If you share your wiki with others, this will create a severe problem in the future and may even hurt TiddlyWiki’s reputation.

What’s the library you use. There may be a possibility to “catch” those errors in a better way, instead of hiding them. :see_no_evil: should not be a way we solve problems.

The library is a-frame. It’s a DOM-based way of integrating 3D content. it works well with TiddlyWiki’s transclusion system and can be used to build 3D experiences in TW.

I think the library assumes control over the event stack, so it gets surprised if key input comes into an element not owned by the framework.

How did you include it into TW. There is the github repo: aframe/dist at master · aframevr/aframe · GitHub

Which version do you use? Did you include it as described here: Introduction – A-Frame ? or did you use a CDN to include it.

It may be possible to include a-frame pages as iframes into TW. IFrames would probably be independent from TW errors. But I’m not sure about that. — It’s just an idea.

sounds very interesting!