Skip to content

Commit

Permalink
Display better error message for unexpected responses from JabRef
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Mar 19, 2024
1 parent f576635 commit ef25887
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit ef25887

Please sign in to comment.