Handle json parse error when testing urls
This commit is contained in:
@@ -56,9 +56,16 @@ export async function serverAddress() {
|
||||
return;
|
||||
}
|
||||
|
||||
let config;
|
||||
try {
|
||||
config = await resp.json();
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
url,
|
||||
config: await resp.json()
|
||||
config
|
||||
};
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user