---
title: "M. Suman Patra (@msuman) | Hashnode"
description: "Developer. Read the latest articles by M. Suman Patra on Hashnode."
url: "https://hashnode.com/@msuman"
---

@msuman

# M. Suman Patra

@msuman · Joined December 2020

Developer

## Comments

[Tapas Adhikary, Thanks for the info and will be waiting for ur next youtube video.](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/6149707517da986cea648e81#reply-614991c817da986cea64927a)

Reply · Article · Sep 21, 2021 · [6 Common mistakes in using JavaScript Promises](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580)

[Tapas Adhikary, To catch test function errors gracefully, I am using catch callback but I thought then callback is not needed because I am not waiting for test function execution and also not returning anything from API call/from the test function. Note: As the request dependency does not support async/await, I had to use promise constructor.](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/6149707517da986cea648e81#reply-6149893617da986cea649165)

Reply · Article · Sep 21, 2021 · [6 Common mistakes in using JavaScript Promises](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580)

[Really Nice article !! I will take this opportunity to clear my doubts. I code as per below. const request = require('request'); const test = userData => { console.log('test::parameters', userData); if (userData && userData.request === true) { const option = { method: 'POST', url: 'https://jsonplaceholder.typicode.com/posts', headers: { 'Content-type': 'application/json; charset=UTF-8' }, json: true, proxy: null, body: { title: 'foo', body: 'bar', userId: 1 } }; console.log('test::outgoingBody::', option); return new Promise((resolve, reject) => { request(option, (error, response) => { if (error) { return reject(error); } else { if (response && response.body ) { return resolve(); } else { return reject(new Error('Error Response')); } } }); }); } else { return Promise.reject(new Error('Invalid Userdata')); } }; //some business logics test().catch(err=>console.error(err)) //some business logics //-------------------------- //some business logics test({request:true}).catch(err=>console.error(err)) //some business logics As I am not returning anything from test function, I don't use then callback. I use Promise.reject to throw any synchronous error. Am I doing correctly?](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580/comment/6149707517da986cea648e81)

Comment · Article · Sep 21, 2021 · [6 Common mistakes in using JavaScript Promises](https://hashnode.com/posts/common-mistakes-in-using-javascript-promises/61486c2e699fe76cd3484580)

[Great article. Share Github repo url.](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4/comment/5fe2d5c5e28a2b6bca52c3ca)

Comment · Article · Dec 23, 2020 · [Single Sign-On, JWT Authentication, and React](https://hashnode.com/posts/single-sign-on-jwt-authentication-and-react/5fe22997c65ad56bef3a30b4)
