---
title: "Comment by Matthew Wang on \"Nuances of Server Actions in Next.js\" | Hashnode"
description: "\"Error handling is done by returning an error in the catch block of a try-catch statement. That's then sent up to your nearest error UI boundary which you defin"
url: "https://hashnode.com/posts/nuances-of-server-actions-in-nextjs/6635d9be56e44a9599027fb0/comment/66cc17a1a872c8b110567386"
---

[Discussion](https://hashnode.com/posts/nuances-of-server-actions-in-nextjs/6635d9be56e44a9599027fb0)

Comment [Nuances of Server Actions in Next.js](https://hashnode.com/posts/nuances-of-server-actions-in-nextjs/6635d9be56e44a9599027fb0)

[Matthew Wang](https://hashnode.com/@matowang)

[Aug 26, 2024](https://hashnode.com/posts/nuances-of-server-actions-in-nextjs/6635d9be56e44a9599027fb0/comment/66cc17a1a872c8b110567386)

"Error handling is done by returning an error in the catch block of a try-catch statement.

That's then sent up to your nearest error UI boundary which you define like error.tsx."

I'm pretty sure the error is sent up only if you throw?
