ui: improve OOM detection message

When SQLite tries to create in-memory tables that are
too large, the query fails with "out of memory".
Turn that into our usual managed dialog that tells
people what to do.

Bug: 322036159
Change-Id: Ie62f937b2607ff70b6fab96a0ce63f4989079f5e
diff --git a/ui/src/frontend/error_dialog.ts b/ui/src/frontend/error_dialog.ts
index 5f4b82a..36fbe4e 100644
--- a/ui/src/frontend/error_dialog.ts
+++ b/ui/src/frontend/error_dialog.ts
@@ -34,7 +34,8 @@
   const now = performance.now();
 
   // Here we rely on the exception message from onCannotGrowMemory function
-  if (err.message.includes('Cannot enlarge memory')) {
+  if (err.message.includes('Cannot enlarge memory') ||
+      /^out of memory$/m.exec(err.message)) {
     showOutOfMemoryDialog();
     // Refresh timeLastReport to prevent a different error showing a dialog
     timeLastReport = now;