Skip to content

Commit b8de4b0

Browse files
Merge pull request #19 from php-debugger/drop-error-handling
fold error notifications into logging and drop the error handling page
2 parents 69eb5a3 + d855fd9 commit b8de4b0

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

docs/user-guide/error-handling.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/user-guide/logging.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ title: Logging
44

55
Two different things get called logging here, and they solve different problems.
66

7-
One is your own output — the `echo` and `var_dump()` you scatter about — arriving
8-
in your editor instead of the response body. The other is the debugger's own log,
9-
which is what you reach for when the debugger itself is not behaving.
7+
One is what your request produces as it runs — the `echo` and `var_dump()` you
8+
scatter about, and the warnings PHP raises along the way — arriving in your editor
9+
instead of the response body. The other is the debugger's own log, which is what
10+
you reach for when the debugger itself is not behaving.
1011

11-
## Your script's output in the editor
12+
## What your request produces
13+
14+
### Your script's output
1215

1316
Your editor can ask for a copy of everything the script writes to standard output.
1417
`echo`, `print_r()`, `var_dump()`, whatever a framework writes — all of it appears
@@ -46,6 +49,23 @@ in the PHP error log for it.
4649

4750
:::
4851

52+
### Errors, warnings and notices
53+
54+
Separately from that output, your editor can ask to be told about every diagnostic
55+
PHP raises — errors, warnings, notices and deprecations — as they occur. Each one
56+
arrives with its message, its file and its line, and the script keeps running.
57+
58+
This is the middle ground between the two extremes. Ignoring a warning means
59+
finding it later in a log, if at all; breaking on one, with an
60+
[exception breakpoint](./breakpoints.md#exception-breakpoints) on `Warning`, stops
61+
you dead every time it fires. A notification just tells you, in order, alongside
62+
everything else the request did.
63+
64+
This is a separate editor setting from output capture, negotiated the same way and
65+
likewise off unless your editor asks for it. It is worth turning on and leaving
66+
on: a deprecation you would never have gone looking for is exactly the kind of
67+
thing that turns up in that panel.
68+
4969
## The debugger's own log
5070

5171
The debug log is for the times the debugger is the problem: the session never

sidebars.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const sidebars = {
3939
'user-guide/inspect-variables',
4040
'user-guide/watches-and-edits',
4141
'user-guide/logging',
42-
'user-guide/error-handling',
4342
],
4443
},
4544
{

0 commit comments

Comments
 (0)