From 12c13132842f95077f22c67b259f88fb3c0ac85b Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 25 Sep 2014 14:31:09 +0200 Subject: [PATCH] Exception docs --- pq/Exception.md | 37 ++++++++++++++++++++++++ pq/Exception/BadMethodCallException.md | 8 +++++ pq/Exception/DomainException.md | 13 +++++++++ pq/Exception/InvalidArgumentException.md | 7 +++++ pq/Exception/RuntimeException.md | 10 +++++++ 5 files changed, 75 insertions(+) create mode 100644 pq/Exception.md create mode 100644 pq/Exception/BadMethodCallException.md create mode 100644 pq/Exception/DomainException.md create mode 100644 pq/Exception/InvalidArgumentException.md create mode 100644 pq/Exception/RuntimeException.md diff --git a/pq/Exception.md b/pq/Exception.md new file mode 100644 index 0000000..4bdea5b --- /dev/null +++ b/pq/Exception.md @@ -0,0 +1,37 @@ +# interface pq\Exception + +A base interface for all pq\Exception classes. + +## Constants: + +* INVALID_ARGUMENT + An invalid argument was passed to a method (pq\Exception\InvalidArgumentException). +* RUNTIME + A runtime exception occurred (pq\Exception\RuntimeException). +* CONNECTION_FAILED + The connection failed (pq\Exception\RuntimeException). +* IO + An input/output exception occurred (pq\Exception\RuntimeException). +* ESCAPE + Escaping an argument or identifier failed internally (pq\Exception\RuntimeException). +* UNINITIALIZED + An object's constructor was not called (pq\Exception\BadMethodCallException). +* BAD_METHODCALL + Calling this method was not expected (yet) (pq\Exception\BadMethodCallException). +* SQL + SQL syntax error (pq\Exception\DomainException). +* DOMAIN + Implementation domain error (pq\Exception\DomainException). + + +## Example: + + getMessage(), $e->getCode()); + } + + ?> diff --git a/pq/Exception/BadMethodCallException.md b/pq/Exception/BadMethodCallException.md new file mode 100644 index 0000000..82f07d1 --- /dev/null +++ b/pq/Exception/BadMethodCallException.md @@ -0,0 +1,8 @@ +# class pq\Exception\BadMethodCallException extends BadMethodCallException implements pq\Exception + +A method calls was not expected. + +## Codes: + +* pq\Exception::UNINITIALIZED +* pq\Exception::BAD_METHODCALL diff --git a/pq/Exception/DomainException.md b/pq/Exception/DomainException.md new file mode 100644 index 0000000..00ddd3d --- /dev/null +++ b/pq/Exception/DomainException.md @@ -0,0 +1,13 @@ +# class pq\Exception\DomainException extends DomainException implements pq\Exception + +Implementation or SQL syntax error. + +## Codes: + +* pq\Exception::SQL +* pq\Exception::DOMAIN + +## Properties: + +* public string $sqlstate + The SQLSTATE code, see the [official documentation](http://www.postgresql.org/docs/current/static/errcodes-appendix.html) for further information. diff --git a/pq/Exception/InvalidArgumentException.md b/pq/Exception/InvalidArgumentException.md new file mode 100644 index 0000000..dd11127 --- /dev/null +++ b/pq/Exception/InvalidArgumentException.md @@ -0,0 +1,7 @@ +# class pq\Exception\InvalidArgumentException extends InvalidArgumentException implements pq\Exception + +An invalid argument was passed to a method. + +## Codes: + + * pq\Exception::INVALID_ARGUMENT diff --git a/pq/Exception/RuntimeException.md b/pq/Exception/RuntimeException.md new file mode 100644 index 0000000..26d4deb --- /dev/null +++ b/pq/Exception/RuntimeException.md @@ -0,0 +1,10 @@ +# class pq\Exception\RuntimeException extends RuntimeException implements pq\Exception + +A runtime exception occurred. + +## Codes: + +* pq\Exception::RUNTIME +* pq\Exception::CONNECTION_FAILED +* pq\Exception::IO +* pq\Exception::ESCAPE -- 2.30.2