mirror of
https://github.com/chris2511/xca.git
synced 2026-09-12 19:51:05 +05:00
Extend Error messages by line and function
Every detail can help
This commit is contained in:
parent
c351612846
commit
a8ebef92cb
@ -159,14 +159,22 @@ void *d2i_bytearray(void *(*d2i)(void *, unsigned char **, long),
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __ecb(const char *st, size_t len, void *u)
|
||||
{
|
||||
QByteArray *ba = (QByteArray *)u;
|
||||
ba->append(st, len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void _openssl_error(const QString &txt, const char *file, int line)
|
||||
{
|
||||
QString error;
|
||||
QByteArray ba;
|
||||
|
||||
while (int i = ERR_get_error() ) {
|
||||
error += QString(ERR_error_string(i, NULL)) + "\n";
|
||||
ERR_print_errors_cb(__ecb, &ba);
|
||||
if (!ba.isEmpty()) {
|
||||
fputs(CCHAR(QString("OpenSSL error (%1:%2) : %3\n").
|
||||
arg(file).arg(line).arg(ERR_error_string(i, NULL))),
|
||||
arg(file).arg(line).arg(QString::fromLatin1(ba))),
|
||||
stderr);
|
||||
}
|
||||
if (!error.isEmpty()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user