← All changes
|
includes/integrations/class-google-analytics-client.php
+6
-0
1.30.0
→
2.12.0
View file →
| @@ -84,10 +84,16 @@ | ||
| 84 | 84 | 'dimensions_count' => count($result['dimensions'] ?? []), |
| 85 | 85 | 'metrics_count' => count($result['metrics'] ?? []) |
| 86 | 86 | ]; |
| 87 | 87 | } catch (\Exception $e) { |
| 88 | + // `message` as well as `error`: the success branch above reports | |
| 89 | + // its outcome as `message`, and every consumer reads that key, so | |
| 90 | + // a failure that only set `error` was reported to the admin as an | |
| 91 | + // error with no reason at all (#852). `error` is kept for any | |
| 92 | + // caller that already reads it. | |
| 88 | 93 | return [ |
| 89 | 94 | 'success' => false, |
| 95 | + 'message' => $e->getMessage(), | |
| 90 | 96 | 'error' => $e->getMessage() |
| 91 | 97 | ]; |
| 92 | 98 | } |
| 93 | 99 | } |