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?
{at the beginning. If it's a typical instance of Error then use @Ryan's solution. Iferror.messagefor some reason contains JSON andErroris a key, then useJSON.parse(error.message).Erroras @Avihay suggested to extract the error{is formatting from e.g.console.log('%o', new Error())