1 # interface http\Exception
3 The http extension's Exception interface.
5 Use it to catch any Exception thrown by pecl/http.
7 The individual exception classes extend their equally named native PHP extensions, if such exist, and implement this empty interface. For example the http\Exception\BadMethodCallException extends SPL's BadMethodCallException.
16 $req = new http\Env\Request;
19 $messages = $req->splitMultipartBody();
20 } catch (http\Exception\BadMethodCallException $e) {
21 // doh, no multipart message
22 } catch (http\Exception\BadMessageException $e) {
23 // failure while parsing
24 } catch (http\Exception $e) {
25 // here we used the interface to catch any http\Exception
26 } catch (Exception $e) {
27 // catch any other exception (unlikely, though)