typo, parameter and type fixes
[mdref/mdref-pq] / pq / Exception.md
1 # interface pq\Exception
2
3 A base interface for all pq\Exception classes.
4
5 ## Constants:
6
7 * INVALID_ARGUMENT
8 An invalid argument was passed to a method (pq\Exception\InvalidArgumentException).
9 * RUNTIME
10 A runtime exception occurred (pq\Exception\RuntimeException).
11 * CONNECTION_FAILED
12 The connection failed (pq\Exception\RuntimeException).
13 * IO
14 An input/output exception occurred (pq\Exception\RuntimeException).
15 * ESCAPE
16 Escaping an argument or identifier failed internally (pq\Exception\RuntimeException).
17 * UNINITIALIZED
18 An object's constructor was not called (pq\Exception\BadMethodCallException).
19 * BAD_METHODCALL
20 Calling this method was not expected (yet) (pq\Exception\BadMethodCallException).
21 * SQL
22 SQL syntax error (pq\Exception\DomainException).
23 * DOMAIN
24 Implementation domain error (pq\Exception\DomainException).
25
26
27 ## Example:
28
29 <?php
30
31 try {
32 $connection = new pq\Connection;
33 } catch (pq\Exception $e) {
34 printf("%s (%d)\n", $e->getMessage(), $e->getCode());
35 }
36
37 ?>