This serverless function has crashed

But you saw this custom error page instead of a default 500 error message because Netlify supports custom error handling for Edge Functions

Error page

An error page doesn't have to be this ugly. You can direct the user to whatever you like and elegantly handle the error behind the scenes

Examples of other error handling options