mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 22:03:06 +01:00
Fix: print traceback only on internal error
This commit is contained in:
parent
b5c759a68b
commit
70e79d417c
@ -3,6 +3,8 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
int err_internal_error = 0;
|
||||||
|
|
||||||
void print_error(const char *error_msg)
|
void print_error(const char *error_msg)
|
||||||
{
|
{
|
||||||
/* We print errors to stdout because lf file manager
|
/* We print errors to stdout because lf file manager
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
#define ERRCHK_PRINT_(...) \
|
#define ERRCHK_PRINT_(...) \
|
||||||
do { \
|
do { \
|
||||||
int __a = 0; \
|
int __a = 0; \
|
||||||
__VA_OPT__(PRINTINTERR(__VA_ARGS__); __a = 1;) \
|
__VA_OPT__(PRINTINTERR(__VA_ARGS__); __a = err_internal_error = 1;) \
|
||||||
if (!__a) \
|
if (!__a && err_internal_error) \
|
||||||
PRINTINTERR(); \
|
PRINTINTERR(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
@ -78,6 +78,8 @@
|
|||||||
#define ERRCHK_RET_OK(e) ERRCHK_RET((e) != OK)
|
#define ERRCHK_RET_OK(e) ERRCHK_RET((e) != OK)
|
||||||
#define ERRCHK_GOTO_OK(e, r, l) ERRCHK_GOTO((e) != OK, r, l)
|
#define ERRCHK_GOTO_OK(e, r, l) ERRCHK_GOTO((e) != OK, r, l)
|
||||||
|
|
||||||
|
extern int err_internal_error;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
OK,
|
OK,
|
||||||
ERR,
|
ERR,
|
||||||
|
Loading…
Reference in New Issue
Block a user