From: gggeek Date: Fri, 20 Jan 2023 11:30:13 +0000 (+0000) Subject: add throw_on_fault option to the Wrapper X-Git-Tag: 4.10.0~119 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=79eb3efb9b5cb7c079f9ebbab11775e2add3414c;p=plcapi.git add throw_on_fault option to the Wrapper --- diff --git a/NEWS.md b/NEWS.md index f5dc55d6..69f0d456 100644 --- a/NEWS.md +++ b/NEWS.md @@ -27,6 +27,9 @@ * new: it is now possible to inject a custom logger into helper classes `Charset`, `Http`, `XMLParser`, inching a step closer to supporting DIC patterns +* new: when calling `Wrapper::wrapXmlrpcMethod`, it is possible to pass 'throw_on_fault' as option to argument + `$extraOptions`. This will make the generated function throw on errors instead of returning a Response object + * improved: all the Client's `setSomething()` methods now return the client object, allowing for usage of fluent style calling. The same applies to `Request::setDebug` @@ -58,6 +61,8 @@ set. We expect this to affect few users, as setting `PhpXmlRpc::$internal_encoding` to a custom character set did not make a lot of sense beforehand - parameters `$timeout` and `$method` are now considered deprecated in `Client::send()` and `Client::multicall()` + - the code generated by the debugger when using "Generate stub for method call" will throw on errors instead of + returning a Response object for library extenders diff --git a/debugger/action.php b/debugger/action.php index ec22c44c..83205c4f 100644 --- a/debugger/action.php +++ b/debugger/action.php @@ -526,7 +526,12 @@ if ($action) { } else { $wrapper = new PhpXmlRpc\Wrapper(); } - $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc); + $code = $wrapper->buildWrapMethodSource( + $client, + $method, + array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix, 'throw_on_fault' => true), + str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc + ); //if ($code) //{ echo "
\n"; @@ -578,7 +583,8 @@ if ($action) {

Changelog