(ex)
| 1125 | * https://github.com/davepacheco/node-extsprintf/blob/master/lib/extsprintf.js |
| 1126 | */ |
| 1127 | function getFullErrorStack(ex) |
| 1128 | { |
| 1129 | var ret = ex.stack || ex.toString(); |
| 1130 | if (ex.cause && typeof (ex.cause) === 'function') { |
| 1131 | var cex = ex.cause(); |
| 1132 | if (cex) { |
| 1133 | ret += '\nCaused by: ' + getFullErrorStack(cex); |
| 1134 | } |
| 1135 | } |
| 1136 | return (ret); |
| 1137 | } |
| 1138 | |
| 1139 | // Serialize an Error object |
| 1140 | // (Core error properties are enumerable in node 0.4, not in 0.6). |