Skip to content

Commit

Permalink
Improved the error catching when opening the See Details modal window
Browse files Browse the repository at this point in the history
  • Loading branch information
FMaz008 committed Oct 9, 2024
1 parent 306910e commit e8d9d1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
8 changes: 6 additions & 2 deletions scripts/bootloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,13 @@ window.addEventListener("message", async function (event) {
if (event.data.type && event.data.type == "error") {
//Show a notification
let note = new ScreenNotification();
note.title = "Broken product detected.";
note.title = "Product unavailable.";
note.lifespan = 10;
note.content = "Item broken with error " + event.data.data.error + ".";
note.content =
"<strong>Type:</strong> " +
event.data.data.errorType +
"<br/><strong>Details:</strong> " +
event.data.data.error;
await Notifications.pushNotification(note);
}

Expand Down
19 changes: 9 additions & 10 deletions scripts/inj.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ window.fetch = async (...args) => {
let { result, error } = extHelper_responseData;

if (result === null) {
if (error?.exceptionType) {
window.postMessage(
{
type: "error",
data: {
error: error.exceptionType,
},
window.postMessage(
{
type: "error",
data: {
errorType: error.exceptionType,
error: error.message,
},
"/" //message should be sent to the same origin as the current document.
);
}
},
"/" //message should be sent to the same origin as the current document.
);
return response;
}

Expand Down

0 comments on commit e8d9d1b

Please sign in to comment.