mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-08 02:31:18 +12:00
feat: error handling
This commit is contained in:
parent
f5dd6879a2
commit
7f467ed2d1
|
@ -25,7 +25,8 @@ export async function fetchNode({
|
|||
);
|
||||
|
||||
return JSON.parse(fileContent);
|
||||
} catch {
|
||||
} catch (error_) {
|
||||
console.error(error_);
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +39,8 @@ export async function fetchNode({
|
|||
);
|
||||
|
||||
return await fileContent.json();
|
||||
} catch {
|
||||
} catch (error_) {
|
||||
console.error(error_);
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@ export async function fetchSitemap({
|
|||
);
|
||||
|
||||
return JSON.parse(fileContent);
|
||||
} catch {
|
||||
} catch (error_) {
|
||||
console.error(error_);
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +32,8 @@ export async function fetchSitemap({
|
|||
);
|
||||
|
||||
return await fileContent.json();
|
||||
} catch {
|
||||
} catch (error_) {
|
||||
console.error(error_);
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue