Replace remaining PHP errors with PHP exceptions
`SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;` are no longer supported (these are really all internal implementation details and none are documented aside from brief mentions in CHANGES for the first three). I wasn't able to find any uses at least in FOSS code via code search tools. If you are using these: Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code); SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1 and do the same as the individual calls in older SWIG). `SWIG_FAIL();` and `goto thrown;` can typically be replaced with `SWIG_fail;`. This will probably also work with older SWIG, but please test with your wrappers if this is important to you. Fixes #2014
This commit is contained in:
parent
cdc69f9843
commit
17a294cec4
7 changed files with 41 additions and 68 deletions
|
|
@ -25,7 +25,7 @@
|
|||
code == SWIG_DivisionByZero ? zend_ce_division_by_zero_error : \
|
||||
code == SWIG_SyntaxError ? zend_ce_parse_error : \
|
||||
code == SWIG_OverflowError ? zend_ce_arithmetic_error : \
|
||||
NULL, msg, code); goto thrown; } while (0)
|
||||
NULL, msg, code); SWIG_fail; } while (0)
|
||||
%}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue