reference/errorfunc/functions/trigger-error.xml
d715365c098db000eaf7dcd987ee6093f6e83091
...
...
@@ -9,9 +9,9 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>bool</type><methodname>trigger_error</methodname>
13
-
<methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>error_type</parameter><initializer>E_USER_NOTICE</initializer></methodparam>
12
+
<type>true</type><methodname>trigger_error</methodname>
13
+
<methodparam><type>string</type><parameter>message</parameter></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>error_level</parameter><initializer><constant>E_USER_NOTICE</constant></initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Used to trigger a user error condition, it can be used in conjunction
...
...
@@ -30,7 +30,7 @@
30
30
<para>
31
31
<variablelist>
32
32
<varlistentry>
33
-
<term><parameter>error_msg</parameter></term>
33
+
<term><parameter>message</parameter></term>
34
34
<listitem>
35
35
<para>
36
36
The designated error message for this error. It's limited to 1024
...
...
@@ -40,7 +40,7 @@
40
40
</listitem>
41
41
</varlistentry>
42
42
<varlistentry>
43
-
<term><parameter>error_type</parameter></term>
43
+
<term><parameter>error_level</parameter></term>
44
44
<listitem>
45
45
<para>
46
46
The designated error type for this error. It only works with the E_USER
...
...
@@ -55,11 +55,43 @@
55
55
<refsect1 role="returnvalues">
56
56
&reftitle.returnvalues;
57
57
<para>
58
-
This function returns &false; if wrong <parameter>error_type</parameter> is
59
-
specified, &true; otherwise.
58
+
&return.true.always;
60
59
</para>
61
60
</refsect1>
62
61

62
+
<refsect1 role="errors">
63
+
&reftitle.errors;
64
+
<para>
65
+
This function throws a <classname>ValueError</classname> if
66
+
<parameter>error_level</parameter> is not one of
67
+
<constant>E_USER_ERROR</constant>, <constant>E_USER_WARNING</constant>,
68
+
<constant>E_USER_NOTICE</constant>, <constant>E_USER_DEPRECATED</constant>.
69
+
</para>
70
+
</refsect1>
71
+

72
+
<refsect1 role="changelog">
73
+
&reftitle.changelog;
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>8.0.0</entry>
85
+
<entry>
86
+
The function now throws a <classname>ValueError</classname> if an invalid
87
+
<parameter>error_level</parameter> is specified. Previously, it returned &false;.
88
+
</entry>
89
+
</row>
90
+
</tbody>
91
+
</tgroup>
92
+
</informaltable>
93
+
</refsect1>
94
+

63
95
<refsect1 role="examples">
64
96
&reftitle.examples;
65
97
<para>
...
...
@@ -85,7 +117,7 @@ if ($divisor == 0) {
85
117
&reftitle.notes;
86
118
<warning>
87
119
<para>
88
-
HTML entities in <parameter>error_msg</parameter> are not
120
+
HTML entities in <parameter>message</parameter> are not
89
121
escaped. Use <function>htmlentities</function> on the message if
90
122
the error is to be displayed in a browser.
91
123
</para>
...
...
@@ -104,7 +136,6 @@ if ($divisor == 0) {
104
136
</para>
105
137
</refsect1>
106
138
</refentry>
107
-

108
139
<!-- Keep this comment at the end of the file
109
140
Local variables:
110
141
mode: sgml
111
142