Skip to content

Commit

Permalink
Check response code when fetching monitoring code
Browse files Browse the repository at this point in the history
  • Loading branch information
blu3r4y committed Sep 11, 2024
1 parent 371d09e commit bb92c01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ async function fetchMonitoringCode() {
if (process.env.DYNATRACE_API_TOKEN) {
const url = `https://bjd63129.dev.dynatracelabs.com/api/v1/rum/jsInlineScript/APPLICATION-54BCAC95EB286EE9?Api-Token=${process.env.DYNATRACE_API_TOKEN}`;
const respose = await fetch(url);
return respose.text();
} else {
return "<!-- could not fetch monitoring code -->";
if (respose.ok) {
return respose.text();
}
}

return "<!-- could not fetch monitoring code -->";
}

const appConfig = async (env, options) => {
Expand Down

0 comments on commit bb92c01

Please sign in to comment.