When the realtime model gets too big, for whatever reason, the realtime client throws an error something like: "Error: Class$S383: Model size limit has been exceeded. Used: 10486181 bytes; Limit: 10485760 bytes at... "
As far as I know, there isn't a documented gapi.drive.realtime.ErrorType that matches, so currently I'm using the following to identify it:
try {
changeModelInSomeWay(rtModel);
} catch (e) {
if (e && e.message && e.message.indexOf("Class$S383") > -1) {
// Model is just too darn big:
doSomething();
} else {
doSomethingElse(e);
}
};
...which seems to work for now, but feels fragile, prone-to-change etc.
UPDATE:
Yep, it IS fragile, I've now seen the identical error except with the class Class$S390 instead. If there's anyone still monitoring the Realtime API tag, some sort of answer would be really appreciated...
What's the correct, or at least a reliable way to identify this error?