Skip to content

Commit

Permalink
Merge pull request #889 from dhmjhu/source-data-error-escape-202407
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Jul 10, 2024
2 parents 29599c1 + ee2c30e commit 5aa4a4c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ export class GuidedSourceDataPage extends ManagedPage {

if (result.message) {
const [type, ...splitText] = result.message.split(":");
const escapedType = type.replaceAll("<", "&lt").replaceAll(">", "&gt");
const text = splitText.length
? splitText.join(":").replaceAll("<", "&lt").replaceAll(">", "&gt")
: result.traceback
? `<small><pre>${result.traceback.trim().split("\n").slice(-2)[0].trim()}</pre></small>`
: "";

const message = `<h4 style="margin: 0;">Request Failed</h4><small>${type}</small><p>${text}</p>`;
const message = `<h4 style="margin: 0;">Request Failed</h4><small>${escapedType}</small><p>${text}</p>`;
this.notify(message, "error");
throw result;
}
Expand Down

0 comments on commit 5aa4a4c

Please sign in to comment.