mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 13:53:07 +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 "utils.h"
|
||||
|
||||
int err_internal_error = 0;
|
||||
|
||||
void print_error(const char *error_msg)
|
||||
{
|
||||
/* We print errors to stdout because lf file manager
|
||||
|
14
src/error.h
14
src/error.h
@ -23,12 +23,12 @@
|
||||
PRINTINTERR(INTERRMSG f "() failed" __VA_OPT__(": %s", __VA_ARGS__))
|
||||
|
||||
#ifndef NO_TRACEBACK
|
||||
#define ERRCHK_PRINT_(...) \
|
||||
do { \
|
||||
int __a = 0; \
|
||||
__VA_OPT__(PRINTINTERR(__VA_ARGS__); __a = 1;) \
|
||||
if (!__a) \
|
||||
PRINTINTERR(); \
|
||||
#define ERRCHK_PRINT_(...) \
|
||||
do { \
|
||||
int __a = 0; \
|
||||
__VA_OPT__(PRINTINTERR(__VA_ARGS__); __a = err_internal_error = 1;) \
|
||||
if (!__a && err_internal_error) \
|
||||
PRINTINTERR(); \
|
||||
} while (0)
|
||||
#endif
|
||||
#ifdef NO_TRACEBACK
|
||||
@ -78,6 +78,8 @@
|
||||
#define ERRCHK_RET_OK(e) ERRCHK_RET((e) != OK)
|
||||
#define ERRCHK_GOTO_OK(e, r, l) ERRCHK_GOTO((e) != OK, r, l)
|
||||
|
||||
extern int err_internal_error;
|
||||
|
||||
enum {
|
||||
OK,
|
||||
ERR,
|
||||
|
Loading…
Reference in New Issue
Block a user