Skip to content

Commit

Permalink
add catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhem-lm committed Feb 25, 2025
1 parent d48b2dd commit e6676f6
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 e6676f6

Please sign in to comment.