Skip to content

Commit 69f954b

Browse files
committed
AC-11717 Dont throw console error for customer data if the request is blocked or cancelled
1 parent d3511ca commit 69f954b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2015 Adobe
3+
* All Rights Reserved.
44
*/
55

66
/**
@@ -95,7 +95,10 @@ define([
9595
parameters['force_new_section_timestamp'] = forceNewSectionTimestamp;
9696

9797
return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
98-
throw new Error(jqXHR);
98+
// don't throw error if the request is cancelled or blocked
99+
if (jqXHR.status !== 0) {
100+
throw new Error(jqXHR);
101+
}
99102
});
100103
}
101104
};

0 commit comments

Comments
 (0)