---
title: "Discussion on \"Refactoring to Avoid Try and Catch Block in Promises\" | Hashnode"
description: "Discussion on \"Refactoring to Avoid Try and Catch Block in Promises\". 🤔 Why do we need this?\nI like async...await to handle promises but sometimes I don't like try...catch block in linear coding in a function. Basically, I hate nesting...\n😥 Problems\n\nExtra number of lines\nNesting code with extra variable declaration\n..."
url: "https://hashnode.com/posts/refactoring-to-avoid-try-and-catch-block-in-promises/62a62e9b165482d2b3eeecd2"
---

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

Discussion

# [Refactoring to Avoid Try and Catch Block in Promises](https://devioand.hashnode.dev/refactoring-to-avoid-try-and-catch-block-in-promises?utm_source=hashnode&utm_medium=feed)

🤔 Why do we need this? I like async...await to handle promises but sometimes I don't like try...catch block in linear coding in a function. Basically, I hate nesting... 😥 Problems Extra number of lines Nesting code with extra variable declaration ...

Jun 12, 2022 · 2 min read · devioand.hashnode.dev  
Read the article

-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)

## Written by

[Asad Javed](https://hashnode.com/@devioand)

@devioand

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

React JS | Next JS Developer

I am a Javascript Developer, who loves to deliver technical content.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
