From ef258875335216a54344940cc1494d1059e7c6b8 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 19 Mar 2024 21:59:19 +0800 Subject: [PATCH] Display better error message for unexpected responses from JabRef --- connector.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/connector.js b/connector.js index e80d8670..5ca7cdf9 100644 --- a/connector.js +++ b/connector.js @@ -138,8 +138,13 @@ Zotero.Connector = new function() { console.error(`JabRef: Error connecting to JabRef: '${response.output}' at '${response.stacktrace}'`); handleError(response.output, '', response.stacktrace) } else { - console.error(`JabRef: Error connecting to JabRef: '${response.message}' with details '${response.output}' at '${response.stacktrace}'`); - handleError(response.message, response.output, response.stacktrace) + if (response.message) { + console.error(`JabRef: Error connecting to JabRef: '${response.message}' with details '${response.output}' at '${response.stacktrace}'`); + handleError(response.message, response.output, response.stacktrace) + } else { + console.error("JabRef: Error connecting to JabRef. Unexpected response type", response) + handleError("Error connecting to JabRef. Unexpected response type", JSON.stringify(response)) + } } }) .catch(error => {