Catch fetch errors
This commit is contained in:
parent
7f08f0d023
commit
ccddac9010
|
@ -37,6 +37,7 @@ export async function validateConfig(config: {
|
|||
clientId: string
|
||||
clientSecret: string
|
||||
}): Promise<{ valid: boolean; message?: string }> {
|
||||
try {
|
||||
const resp = await fetch(config.url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
@ -57,4 +58,7 @@ export async function validateConfig(config: {
|
|||
}
|
||||
|
||||
return { valid: true }
|
||||
} catch (e: any) {
|
||||
return { valid: false, message: e.message }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue