The http extension's Exception
interface.
Use it to catch any Exception
thrown by pecl/http.
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
.
None.
<?php
$req = new http\Env\Request;
try {
$messages = $req->splitMultipartBody();
} catch (http\Exception\BadMethodCallException $e) {
// doh, no multipart message
} catch (http\Exception\BadMessageException $e) {
// failure while parsing
} catch (http\Exception $e) {
// here we used the interface to catch any http\Exception
} catch (Exception $e) {
// catch any other exception (unlikely, though)
}
?>
A bad conversion (e.g. character conversion) was encountered.
class http\Exception\BadConversionException extends DomainException
implements http\Exception
A bad HTTP header was encountered.
class http\Exception\BadHeaderException extends DomainException
implements http\Exception
A bad HTTP message was encountered.
class http\Exception\BadMessageException extends DomainException
implements http\Exception
A method was called on an object, which was in an invalid or unexpected state.
class http\Exception\BadMethodCallException extends BadMethodCallException
implements http\Exception
A bad querystring was encountered.
class http\Exception\BadQueryStringException extends DomainException
implements http\Exception
A bad HTTP URL was encountered.
class http\Exception\BadUrlException extends DomainException
implements http\Exception
One or more invalid arguments were passed to a method.
class http\Exception\InvalidArgumentException extends InvalidArgumentException
implements http\Exception
A generic runtime exception.
class http\Exception\RuntimeException extends RuntimeException
implements http\Exception
An unexpected value was encountered.
class http\Exception\UnexpectedValueException extends UnexpectedValueException
implements http\Exception