| @@ -195,16 +195,24 @@ | ||
| 195 | 195 | * hourly tick tries again; `no_data` is recorded by the generator after |
| 196 | 196 | * it has already pushed the schedule out a period. Either way the panel |
| 197 | 197 | * shows the reason and when it was last seen. |
| 198 | 198 | * |
| 199 | - * @param string $reason Machine-readable reason. | |
| 199 | + * `fetch_failed` (#912) is recorded by the generator when Search Console | |
| 200 | + * answered with an error; it carries the API's message so the panel can | |
| 201 | + * say what went wrong, and the schedule was moved to a retry. | |
| 202 | + * | |
| 203 | + * @param string $reason Machine-readable reason. | |
| 204 | + * @param string $message Optional plain-text detail, e.g. the API error. | |
| 200 | 205 | */ |
| 201 | - public function record_skip(string $reason): void { | |
| 206 | + public function record_skip(string $reason, string $message = ''): void { | |
| 202 | 207 | $stored = $this->stored(); |
| 203 | 208 | $stored['last_skip'] = [ |
| 204 | 209 | 'reason' => sanitize_key($reason), |
| 205 | 210 | 'at' => current_time('mysql'), |
| 206 | 211 | ]; |
| 212 | + if ($message !== '') { | |
| 213 | + $stored['last_skip']['message'] = sanitize_text_field($message); | |
| 214 | + } | |
| 207 | 215 | update_option(self::OPTION_KEY, $stored, false); |
| 208 | 216 | } |
| 209 | 217 | |
| 210 | 218 | /** |