Skip to content

Commit

Permalink
confluence-copy-link-buttons: fix error handling in onVersion
Browse files Browse the repository at this point in the history
Function onVersion attempts to log a non-existent exception `e`.
Rewrite the log message for cases when `majorVersion` cannot be parsed
as an integer.
  • Loading branch information
rybak committed Aug 15, 2024
1 parent a2ba0c0 commit d04721a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions confluence-copy-link-buttons.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Confluence: copy link buttons
// @namespace https://github.com/rybak
// @version 4
// @version 5
// @description Adds buttons to copy a link to the current page directly into clipboard. Two buttons are supported: Markdown and Jira syntax. Both buttons support HTML for rich text editors.
// @author Andrei Rybak
// @license MIT
Expand All @@ -13,7 +13,7 @@
// ==/UserScript==

/*
* Copyright (c) 2023 Andrei Rybak
* Copyright (c) 2023-2024 Andrei Rybak
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -74,7 +74,7 @@
if (maybeVersionElem) {
const majorVersion = parseInt(maybeVersionElem.content);
if (isNaN(majorVersion)) {
log("Couldn't parse major version", e);
log("Cannot parse major version", maybeVersionElem.content);
return cloudFn();
}
if (majorVersion >= 1000) {
Expand Down

0 comments on commit d04721a

Please sign in to comment.