[wp-trac] [WordPress Trac] #24780: Use error handlers rather than the error suppression operator
WordPress Trac
noreply at wordpress.org
Thu Sep 5 12:12:14 UTC 2013
#24780: Use error handlers rather than the error suppression operator
--------------------------+-----------------------------
Reporter: rmccue | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Filesystem | Version:
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------------
Comment (by johnbillion):
Replying to [comment:3 mark-k]:
> In what way an error handler is better? If I feel that something funny
is going on I just look at the error log file. How will having an error
handler improve anything?
As Ryan stated, fatal errors are also suppressed when the @ operator is
used. This is a complete nightmare when your script dies for no apparent
reason. The only option then is to run Xdebug with xdebug.scream set to
true. It works, but it's far from ideal.
We should audit core in its entirety and remove as many @ operators as
possible. The remaining ones should only be used when WP_DEBUG isn't set
to true ([http://core.trac.wordpress.org/browser/tags/3.6/wp-includes
/class-http.php#L952 example]).
I'll be willing to do this at some point. I just lost an hour due to a
fatal error that was being suppressed.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24780#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list