Compare commits

..

2 Commits

Author SHA1 Message Date
Sergio Álvarez f905d02577
recover the old README
continuous-integration/drone/push Build is passing Details
2023-08-16 11:39:02 +02:00
Sergio Álvarez 0ddde4bc27
more error detail 2023-08-16 11:34:21 +02:00
2 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,18 @@
[![Build Status](https://drone.xrg.io/api/badges/code/xrg.es/status.svg)](https://drone.xrg.io/code/xrg.es)
[![Build Status](https://ci.sergio.am/api/badges/code/xrg.es/status.svg)](https://ci.sergio.am/code/xrg.es)
For more info: `cd docker`
# [PHP Regular Expressions tester](http://xrg.es)
Source code, ofc.
## Thanks to
- Sergio López [@slopezbustos](http://twitter.com/slopezbustos)
- Jordi Rivero [@jrivero](http://twitter.com/jrivero)
- Jorge Massanet [@Percewall](http://twitter.com/Percewall)
- DigitalVirgo I+D team&co-workers <https://www.digitalvirgo.com>
## Copyright and license
Copyright 2014+ Sergio Álvarez [the MIT license](LICENSE).

View File

@ -18,7 +18,10 @@ class PregResponse
public readonly ?string $returnValue,
) {
if (preg_last_error() !== PREG_NO_ERROR) {
throw new Exception('preg_last_error() = '. preg_last_error_msg());
$error = error_get_last();
$detail = preg_last_error() === PREG_INTERNAL_ERROR && !is_null($error) ? (': ' . $error['message']) : '';
throw new Exception('preg_last_error() = ' . preg_last_error_msg() . $detail);
}
}
}