Skip to content

Commit

Permalink
refactor: Fixed linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
htuzel committed Feb 3, 2025
1 parent 79d613a commit 25cc61a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Resource = require('dw/web/Resource');
const stringUtils = require('dw/util/StringUtils');

/**
* Formats standard error message string
* Formats standard error message string
* @param {string} title - Error title, place or function name
* @param {string} url - Url of the service endpoint
* @param {number} error - HTTP response code for an HTTPService
Expand Down Expand Up @@ -106,6 +106,7 @@ function callJsonService(title, service, params) {

var result = null;
var data = null;

try {
result = service.setThrowOnError().call(JSON.stringify(params));
} catch (error) {
Expand All @@ -119,7 +120,7 @@ function callJsonService(title, service, params) {
try {
data = JSON.parse(result.object.response);
statusItem.addDetail('object', data);
} catch (error) {
} catch (parseError) { // eslint-disable-line no-unused-vars
// response is marked as json, but it is not
statusItem.setStatus(Status.ERROR);
logger.error('JSON.parse error. Method: {0}. String: {1}', title, result.object.response);
Expand Down

0 comments on commit 25cc61a

Please sign in to comment.