Posts

Showing posts from January 26, 2019

How to reply to 「いま、すごく幸せです?」

Image
up vote 3 down vote favorite I have a colleague who is blessed with a girl child and I posted a greeting saying おめでとうございます In reply to this, he said  ありがとう。いま、すごく幸せです? I guess he is asking me about my well being. How should I reply to such questions in Japanese if I want to politely say [I'm good thank you!]? phrases greetings share | improve this question edited 2 hours ago asked 2 hours ago VPK 140 5

Implementation of simple request chain logic with promises

Image
up vote 1 down vote favorite I'm trying to implement dummy emulation of following logic: But I'm not sure if I fully understand best practices of how to do it. The main point of this task is to avoid triggering of redundant catch blocks callbacks. IMO if 1st request failed then all following code should stop. I mean: if 1st request was failed, then we do not make 2nd request and do not call catch block of 2nd request promise. In a few words I'm looking for very clean and simple solution like following: firstRequest() .then(r => { console.log('firstRequest success', r); return secondRequest(); }, e => console.log('firstRequest fail', e)) .then(r => { console.log('secondRequest success', r); // Should I return something here? W