error-replacer
Drop this into the replacer
argument in JSON.stringify and you will get meaningful JSON serialization of Error objects.
const errorReplacer = ; // basicsOnly - say true (default) if you only want Error type and message, no stack or file detailsJSON;