---
title: "Discussion on \"Your Agent Wrapped the Whole Function in try/catch and Called It Error Handling\" | Hashnode"
description: "Discussion on \"Your Agent Wrapped the Whole Function in try/catch and Called It Error Handling\". Paste a stack trace, get a try/catch around the whole function. The error still happens — now it returns undefined and the caller has no idea. Wrapping a call is not handling a failure."
url: "https://hashnode.com/posts/agent-try-catch-swallows-the-error/6acacb6170cee0c0e3cfcc5f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Your Agent Wrapped the Whole Function in try/catch and Called It Error Handling](https://blogs.powerduck.com/agent-try-catch-swallows-the-error?utm_source=hashnode&utm_medium=feed)

Paste a stack trace, get a try/catch around the whole function. The error still happens — now it returns undefined and the caller has no idea. Wrapping a call is not handling a failure.

Oct 10 · 4 min read · blogs.powerduck.com  
Read the article

-   [#agenticcoding](https://hashnode.com/tag/agenticcoding)
-   [#ai](https://hashnode.com/tag/ai)
-   [#codereview](https://hashnode.com/tag/codereview)
-   [#errorhandling](https://hashnode.com/tag/errorhandling)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
