0

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
HeyHeyJC
  • 2,627
  • 1
  • 18
  • 27
  • This could be a possible duplicate of this [thread](http://stackoverflow.com/questions/22362484/drive-realtime-api-model-size-limit-exceeded-despite-empty-root). – gerardnimo Jan 23 '16 at 03:24
  • Nope, he's asking what you can do about it, I'm asking how you can identify it. – HeyHeyJC Jan 23 '16 at 03:28
  • 1
    I don't think there is a direct way to identify this error, but I think there is a workaround that could be done by using the [`bytesUsed()`](https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Model.html#bytesUsed). Since the limit is already given at 10485760 bytes, maybe what you can do is compare the bytes that is already used and the 10485760 limit. – gerardnimo Jan 23 '16 at 09:16
  • Well yes, I do that already to prevent the situation in which the error occurs, but there's no way to know if a single change will do it. No matter what, I have to trap and identify the error. – HeyHeyJC Jan 23 '16 at 18:07

0 Answers0