-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtserror.cpp
More file actions
34 lines (29 loc) · 839 Bytes
/
tserror.cpp
File metadata and controls
34 lines (29 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "tserror.h"
void getError()
{
unsigned long er = 0;
char erbuf[512] = {0};
size_t erlen = 512;
/* 获取错误号 */
er = ERR_get_error();
/* 将错误号转变为对应字符串 */
ERR_error_string_n(er, erbuf, erlen);
/* 弹窗显示 */
QMessageBox::warning(NULL,
"warning",
QString::asprintf("%s", erbuf),
QMessageBox::Close,
QMessageBox::Close);
return;
}
void printTSError()
{
char buf[512];
ERR_error_string_n(ERR_get_error(), buf, sizeof(buf));
QMessageBox::warning(NULL,
"Error",
QString::asprintf("%s", buf),
QMessageBox::Close,
QMessageBox::Close);
return;
}