Print all properties of an Error in javascript

Normally an Error class has properties such as name, code, message, stack etc. Some special errors such as OpenSSL Error uses Error class but also have opensslErrorStack etc. How can I print all properties in an Error?

I tried:

process.on('uncaughtException', function(err) {
  for (let i in err) {
    console.log(i + ': ' + err[i]);
  }
});