Revisiting 4xx Error Handling (React Router in a static S3 website)

The Serverless-Stack demo handles 4xx errors using the technique shown at the top of this Stack Overflow posting:

However, there is quite a bit of discussion about the proper way to handle the error in the comments of that posting.

Is the way Serverless-Stack handles errors still the best way. The least “hacky” way?

Here’s another approach:

1 Like

Hmm I’m not actually sure what that second link is doing? Do you know how it’s different from what we are doing in the guide?