antonioalvesA
Windmill2d ago
5 replies
antonioalves

export async function main() {

export async function main() {
try {
const response = await fetch('https://api.example.com/data');
return await response.json();
} catch (error) {
const customError = new Error(error instanceof Error ? error.message : String(error));
customError.name = "418";
customError.stack = "Error: I'm a teapot";
throw customError;
}
}
Was this page helpful?