Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f25c7ce
win,msi: Added Italian translation
mcollina Jan 12, 2016
9db861b
tools: increase lint coverage
Trott Jul 10, 2016
25b3ff4
test,doc: clarify `buf.indexOf(num)` input range
addaleax Jul 8, 2016
45a8fce
doc: fix typo in the CHANGELOG_V6
vsemozhetbyt Jul 6, 2016
8bbb3eb
tools: consistent .eslintrc formatting
silverwind Jul 12, 2016
e1e477e
win,msi: add zh-CN translations for the installer
pmq20 Jul 14, 2016
43b5bf4
inspector: Unify event queues
Jun 1, 2016
ccd4983
test: add common.rootDir
cjihrig Jul 12, 2016
f003465
fs: rename event to eventType in fs.watch listener
claudiorodriguez Jul 1, 2016
1af8c03
test: cleanup IIFE tests
cjihrig Jul 12, 2016
d224b47
test: improve error message in test-tick-processor
Trott Jul 12, 2016
f0d9610
doc: removed old git conflict markers from fs.md
jjhidalgar Jul 7, 2016
3b767b8
buffer: fix creating from zero-length ArrayBuffer
RReverser Jun 6, 2016
c10ade9
deps: back-port d721121 from v8 upstream
bnoordhuis Jul 9, 2016
a855b30
cluster: remove bind() and self
cjihrig Jul 13, 2016
46b9ef6
doc: fix typo in stream doc
Jul 14, 2016
c726ffb
doc: Warn against `uncaughtException` dependency.
lance Apr 25, 2016
9d9bd3c
timers: fix processing of nested timers
whitlockjc Jul 24, 2015
669af6e
doc: fix inconsistencies in code style
saadq Jul 15, 2016
17591c3
test: s/assert.fail/common.fail as appropriate
cjihrig Jul 14, 2016
3bd40ff
deps: no /safeseh for ml64.exe
indutny Jul 16, 2016
60c459c
util: inspect boxed symbols like other primitives
addaleax Jul 9, 2016
ba6ab7c
buffer: optimize hex_decode
chjj Jul 7, 2016
aa045cd
test: fix flaky test-http-server-consumed-timeout
Trott Jul 13, 2016
f7d3af6
doc: add `added:` information for stream
Jun 13, 2016
06bfb9e
src: fix handle leak in Buffer::New()
bnoordhuis Jul 13, 2016
978362d
src: fix handle leak in BuildStatsObject()
bnoordhuis Jul 13, 2016
e46efd9
src: fix handle leak in UDPWrap::Instantiate()
bnoordhuis Jul 13, 2016
61d88d9
src: remove unnecessary HandleScopes
bnoordhuis Jul 13, 2016
62a3ff2
doc: correct sample output of buf.compare
khalsah Jul 17, 2016
9d59b7d
test: avoid usage of mixed IPV6 addresses
gireeshpunathil Jul 13, 2016
059a721
doc: update CTC governance information
Trott Jul 13, 2016
f3182f6
deps: v8_inspector no longer depends on wtf
ofrobots Jul 15, 2016
bb187bb
deps: cherry-pick 1f53e42 from v8 upstream
bnoordhuis Jul 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: Warn against uncaughtException dependency.
State in the documentation that `uncaughtException` is not a reliable
way to restart a crashed application, and clarify that an application
may crash in ways that do not trigger this event.

Use a documented synchronous function in example code.

Fixes: #6223

Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: #6378
  • Loading branch information
lance authored and evanlucas committed Jul 19, 2016
commit c726ffb29ca7a4a58960ba853f304407a950ef40
29 changes: 17 additions & 12 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ most convenient for scripts).
added: v0.1.18
-->

The `'uncaughtException'` event is emitted when an exception bubbles all the
way back to the event loop. By default, Node.js handles such exceptions by
printing the stack trace to `stderr` and exiting. Adding a handler for the
`'uncaughtException'` event overrides this default behavior.
The `'uncaughtException'` event is emitted when an uncaught JavaScript
exception bubbles all the way back to the event loop. By default, Node.js
handles such exceptions by printing the stack trace to `stderr` and exiting.
Adding a handler for the `'uncaughtException'` event overrides this default
behavior.

The listener function is called with the `Error` object passed as the only
argument.
Expand All @@ -161,7 +162,7 @@ For example:

```js
process.on('uncaughtException', (err) => {
console.log(`Caught exception: ${err}`);
fs.writeSync(1, `Caught exception: ${err}`);
});

setTimeout(() => {
Expand Down Expand Up @@ -192,20 +193,24 @@ times nothing happens - but the 10th time, the system becomes corrupted.

The correct use of `'uncaughtException'` is to perform synchronous cleanup
of allocated resources (e.g. file descriptors, handles, etc) before shutting
down the process. It is not safe to resume normal operation after
`'uncaughtException'`.
down the process. **It is not safe to resume normal operation after
`'uncaughtException'`.**

To restart a crashed application in a more reliable way, whether `uncaughtException`
is emitted or not, an external monitor should be employed in a separate process
to detect application failures and recover or restart as needed.

### Event: 'unhandledRejection'
<!-- YAML
added: v1.4.1
-->

The `'unhandledRejection`' event is emitted whenever a `Promise` is rejected and
no error handler is attached to the promise within a turn of the event loop.
no error handler is attached to the promise within a turn of the event loop.
When programming with Promises, exceptions are encapsulated as "rejected
promises". Rejections can be caught and handled using [`promise.catch()`][] and
are propagated through a `Promise` chain. The `'unhandledRejection'` event is
useful for detecting and keeping track of promises that were rejected whose
useful for detecting and keeping track of promises that were rejected whose
rejections have not yet been handled.

The listener function is called with the following arguments:
Expand Down Expand Up @@ -637,7 +642,7 @@ An example of this object looks like:
SHLVL: '1',
HOME: '/Users/maciej',
LOGNAME: 'maciej',
_: '/usr/local/bin/node'
_: '/usr/local/bin/node'
}
```

Expand Down Expand Up @@ -1108,10 +1113,10 @@ console.log(util.inspect(process.memoryUsage()));
Will generate:

```js
{
{
rss: 4935680,
heapTotal: 1826816,
heapUsed: 650472
heapUsed: 650472
}
```

Expand Down