Skip to content

Commit

Permalink
Error log update.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdobeLinhart committed Feb 19, 2025
1 parent b579bd2 commit 5f4f0f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/features/personalization/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,16 @@ const COMMANDS = {
let value;

if (attribute === 'href' && parameter) {
const href = el.getAttribute('href');
const url = new URL(href);
const parameters = new URLSearchParams(url.search);
try {
const href = el.getAttribute('href');
const url = new URL(href);
const parameters = new URLSearchParams(url.search);

parameters.set(parameter, cmd.content);
url.search = parameters.toString();
value = url.toString();
} catch (error) {
console.error('Invalid updateAttribute URL:', cmd.content);
/* c8 ignore next 2 */
console.log(`Invalid updateAttribute URL: ${href}`, error.message || error);
}
} else {
value = cmd.content;
Expand Down

0 comments on commit 5f4f0f1

Please sign in to comment.