Yes, I think an easy way would be to change `xp::errorAt(string $file[, int $line])` to return the errors instead of returning `bool` and then rewrite this as follows:

```diff
- if (xp::errorAt(__FILE__, __LINE__ - 1)) {
-  $message= key(xp::$registry['errors'][__FILE__][__LINE__ - 2]);
+ if ($error= xp::errorAt(__FILE__, __LINE__ - 1)) {
+   $message= key($error);
```

The `$error` variable would contain `array("The warning message" => $count)`.