1 | <?php |
||
13 | class Errors { |
||
14 | |||
15 | /** |
||
16 | * Return the code and details of all known errors. |
||
17 | * |
||
18 | * @return array |
||
19 | */ |
||
20 | public function get_errors() { |
||
44 | |||
45 | /** |
||
46 | * Gets the details for one specific error code |
||
47 | * |
||
48 | * @param string $error_code the error code. |
||
49 | * @return array $error the error details |
||
50 | */ |
||
51 | public function get_error( $error_code ) { |
||
55 | |||
56 | /** |
||
57 | * Keep track of a connection error that was encoutered |
||
58 | * |
||
59 | * @param Connection_Error $error the error object. |
||
60 | * @return void |
||
61 | */ |
||
62 | public function report_error( Connection_Error $error ) { |
||
66 | |||
67 | /** |
||
68 | * Stores the error in the database so we know there is an issue and can inform the user |
||
69 | * |
||
70 | * @param Connection_Error $error the error object. |
||
71 | * @return void |
||
72 | */ |
||
73 | public function store_error( Connection_Error $error ) { |
||
76 | |||
77 | /** |
||
78 | * Informs wpcom servers about the error |
||
79 | * |
||
80 | * @param Connection_Error $error the error object. |
||
81 | * @return void |
||
82 | */ |
||
83 | public function inform_wpcom( Connection_Error $error ) { |
||
86 | |||
87 | /** |
||
88 | * Gets the reported errors stored in the database |
||
89 | * |
||
90 | * @return array $errors |
||
91 | */ |
||
92 | public function get_stored_errors() { |
||
95 | |||
96 | /** |
||
97 | * Delete the reported errors stored in the database |
||
98 | * |
||
99 | * @return array $errors |
||
100 | */ |
||
101 | public function delete_stored_errors() { |
||
104 | |||
105 | /** |
||
106 | * Tries to fix connection errors by disconnecting the site |
||
107 | * |
||
108 | * After disconnecting, clear the reported errors. |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public function fix_disconnect() { |
||
117 | |||
118 | } |
||
119 |