node.js - Error handling with Node Redis client -


I am using the node redis client library and looking to design the argument that handles my error. Can anyone help answer some of the following problems?

In short, I must know whether a written process (including transactions and scripts) is successful or not.

Specifically, I am thinking about the case where the client is disconnected. I am looking at three scenarios:

1) Customer disconnects before starting operation 2) Operation start (), but fail, but the client disconnects before informing the error message 3) Operation (s) are initially successful and, before the feedback is reported, the customer is disconnected

In each scenario, a different action is likely to be required (1 bus command 2 can try again, 2 can understand why the command failed before retry, 3

In which case you are trying to resolve the suit for the promise library I

You want to handle many different types of errors in this way. Are:

  try {// code} hold (e) {if (e instanceof whatiwantError) {// handle} and {throw e;}}   < P> Now Blubber allows it better:  
  var fs = Promise.promisi FyAll (required ("fs"); Fs.readFileAsync ("myfile.json"). Then (JSON.parse) .then (function (json) {console.log ("successful jason")}). Hold (syntax error, function (e) {console.error ("invalid jason in file");}). Hold (promus. Operation error, function (e) {console.error ("unable to read file, because:", e.message);});    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -