docs: function getErrorStack (ex) {
    let ret = ex.stack || ex.toString()
    if (ex.cause && typeof ex.cause === 'function') {
      const cex = ex.cause()
      if (cex) ret += '\nCaused by: ' + getErrorStack(cex)
    }
    return ret
  }