Until recently most of the Errors thrown by Node.js only had a message associated with them. Now changes are coming to Errors thrown by the Node.js runtime from Node.js 8 and will continue to flow in during Version 9. Read about changes coming to Node.js Errors.
In his original post, Michael Dawson explains the matter of changes and suggests on what you should be doing now to get ready.
Before changes came if you wanted to have your code take a specific action based on the Error, you would have had to compare the message string to a known value. Now you might have noticed that there is a typo in the message.
The changes being made are to add a ‘code’ to all of the error objects thrown by the Node.js APIs. These codes are being documented in the API docs in https://nodejs.org/dist/latest-v8.x/docs/api/errors.html#errors_node_js_error_codes
To find details and examples go to the full article we mentioned in the beginning.