jwt-framework
jwt-framework copied to clipboard
better error message
Target branch: 4.x
- [x] It is a Bug fix
- [ ] It is a New feature
- [ ] It is related to dependencies
Includes:
- [ ] Breaks BC
- [ ] Deprecations
The error message if a key fails is not very informational. The openssl extension provides more details, so we need that in the exception thrown.
Hi,
Many thanks for this PR. Howvever it may send truncated messages or false.
An alternative could be as follows:
$opensslMessages = [];
while ($m = openssl_error_string()) {
$opensslmessages[] = $m;
}
throw new InvalidArgumentException('Unable to load the key.', ['opensslMessages' => $opensslMessages]);
EDIT: to be rebased for 3.4.x