Handling WebGL Memory size error - Solved

Even with memory allocation finely tuned to fit a game exactly you will still get situations where it simple won’t load, because especially on 32 bit machines there simply isn’t a block of memory available at the time to open the code. When this happens the user has no idea what is going on and that the solution is simply to close some stuff and that will make it work again. If you don’t look in the console it just looks like a program hang. (which it sort of is)
Is there any way to pick up that error in javascript so that you can pop a message on the screen saying please free up some memory to load this?

Seems
UnityErrorHandler

is the answer