Skip to content

Commit

Permalink
add catch (#5375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhem-lm authored Feb 25, 2025
1 parent 3bf0bc6 commit edcf2d4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/src/lib/components/InstanceSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,14 @@
<Button
disabled={!$enterpriseLicense}
on:click={async (e) => {
const res = await SettingService.testMetadata({
requestBody: $values[setting.key]
})
sendUserToast(`Metadata valid, see console for full content`)
console.log(`Metadata content:`, res)
try {
const res = await SettingService.testMetadata({
requestBody: $values[setting.key]
})
sendUserToast(`Metadata valid: ${res}`)
} catch (error) {
sendUserToast(`Invalid metadata`, true, error.message)
}
}}>Test content/url</Button
>
</div>
Expand Down

0 comments on commit edcf2d4

Please sign in to comment.