How to read error message as a string from error object on Node.js

Viewed 16629

For example I just got this error:

{ Error: There was an error sending your trade offer. We were unable to contact the game's item server. The game's item server may be down or Steam may be experiencing temporary connectivity issues. Please try again later.
    at Object.exports.makeAnError (C:\Some\Boring\Route\node_modules\steam-tradeoffer-manager\lib\helpers.js:17:12)
    at SteamCommunity.manager._community.httpRequestPost...

How do I get just the "There was an error sending your trade offer..." part so I can later send it back to the client?

2 Answers

My err.message is null. I used err.toString() It's saved my ass.

Related