From de04ec11ee1ef131f210acf83938c32c8133e4d8 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 30 Dec 2023 00:02:48 +1100 Subject: [PATCH] Fix for when msgbase with pages cannot be found/opened --- load/page.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/load/page.js b/load/page.js index add93a9..6a383bc 100644 --- a/load/page.js +++ b/load/page.js @@ -1093,21 +1093,23 @@ function Page(debug) { } this.load = function(page) { - var mb = new MsgBase(FRAMES_MSG_BASE); var headers; + var mb = new MsgBase(FRAMES_MSG_BASE); + try { if (mb.open()) { headers = mb.get_all_msg_headers(false,false) || []; } else { - log(LOG_ERROR,code+' cannot be opened:'+mb.error); + log(LOG_ERROR,'! ['+FRAMES_MSG_BASE+'] cannot be opened ['+mb.error+']'); return false; } + // @todo It appears if the message base doesnt exist, we dont error? } catch (e) { - log(LOG_ERROR,code+' cannot be opened:'+e.message); + log(LOG_ERROR,'! ['+FRAMES_MSG_BASE+'] cannot be opened ['+e.message+']'); return false; }