php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #26213 trigger_error with multi-level error
Submitted: 2003-11-12 06:45 UTC Modified: 2017-10-24 01:43 UTC
Votes:7
Avg. Score:4.0 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: php at bouchery dot com Assigned: kalle (profile)
Status: Closed Package: *General Issues
PHP Version: I* OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at bouchery dot com
New email:
PHP Version: OS:

 

 [2003-11-12 06:45 UTC] php at bouchery dot com
Description:
------------
I would like to use trigger_error with an error level like this :
DB_FATAL_ERROR = E_USER_ERROR
XML_FATAL_ERROR = E_USER_ERROR + 1
SOMTHING_FATAL_ERROR = E_USER_ERROR + 2
..etc.

In my error_handler, I'll use these error level to change its behaviour.

It could be a great improvement for error managing to define our user error levels.

Reproduce code:
---------------
<?php

trigger_error( 'My error' , E_USER_ERROR + 1 );

?>

Expected result:
----------------
in error_handler, $errno is equal to "E_USER_ERROR + 1"

Actual result:
--------------
"Warning: Invalid error type specified"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-18 23:18 UTC] jani@php.net
-Package: Feature/Change Request +Package: *General Issues -Operating System: all +Operating System: * -PHP Version: Irrelevant +PHP Version: I*
 [2012-07-16 15:36 UTC] notdefix at hotmail dot com
Duplicate for: #47887 ?
 [2017-10-24 01:43 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2017-10-24 01:43 UTC] kalle@php.net
I don't think this is something we will ever do, the best bet here is to have more extensions output Exceptions. PHP7 moves greatly in that direction with the Engine based exceptions.

This should be an RFC if anything, you can read more about RFC processes at the wiki:
http://wiki.php.net/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC