Skip to content

Commit 0ea0f15

Browse files
committed
avoid clashes in error codes
1 parent 2d8761f commit 0ea0f15

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
* improved: prepare the debugger for json-rpc 2.0 support, which will be in a pending release of the PhpJsonRpc library
1010

11+
* improved: changes some error numbers to avoid conflicts - now errors related to http compression use the range 153-157,
12+
while the range 103-107 is reserved for xml parsing errors
13+
1114
* fixed: the `vm.sh` script would not expose the http ports of the test container to the host
1215

1316

src/PhpXmlRpc.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ class PhpXmlRpc
4343
'xml_not_compliant' => 2, // client
4444
'xml_parsing_error' => 2, // client
4545

46-
/// @todo fix: those do all conflict with $xmlrpcerrxml+X (with X being an `xml_get_error_code` error). Start at 150?
47-
'cannot_decompress' => 103,
48-
'decompress_fail' => 104,
49-
'dechunk_fail' => 105,
50-
'server_cannot_decompress' => 106,
51-
'server_decompress_fail' => 107,
46+
'cannot_decompress' => 153,
47+
'decompress_fail' => 154,
48+
'dechunk_fail' => 155,
49+
'server_cannot_decompress' => 156,
50+
'server_decompress_fail' => 157,
5251
);
5352

5453
/**
@@ -129,7 +128,8 @@ class PhpXmlRpc
129128
/**
130129
* @var int
131130
* Let XML parse errors start at 100.
132-
* The final code will be 100 + X, with X coming from https://www.php.net/manual/en/xml.error-codes.php
131+
* The final code will be 100 + X, with X coming from https://www.php.net/manual/en/xml.error-codes.php.
132+
* Values are known to go from 1 (XML_ERROR_NO_MEMORY) to 21 (XML_ERROR_EXTERNAL_ENTITY_HANDLING)
133133
*/
134134
public static $xmlrpcerrxml = 100;
135135

0 commit comments

Comments
 (0)