mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-10 23:57:38 +00:00
spicec: warn when throwing exception
This helps to identify the code location of exception
This commit is contained in:
parent
788418db65
commit
0ca7704a5a
@ -19,6 +19,7 @@
|
||||
#define _H_UTILS
|
||||
|
||||
#include "common.h"
|
||||
#include "common/log.h"
|
||||
#include <spice/error_codes.h>
|
||||
#include <spice/macros.h>
|
||||
|
||||
@ -38,12 +39,14 @@ private:
|
||||
#define THROW(format, ...) { \
|
||||
std::string exption_string; \
|
||||
string_printf(exption_string, format, ## __VA_ARGS__ ); \
|
||||
spice_warning(format, ## __VA_ARGS__ ); \
|
||||
throw Exception(exption_string); \
|
||||
}
|
||||
|
||||
#define THROW_ERR(err, format, ...) { \
|
||||
std::string exption_string; \
|
||||
string_printf(exption_string, format, ## __VA_ARGS__ ); \
|
||||
spice_warning(format, ## __VA_ARGS__ ); \
|
||||
throw Exception(exption_string, err); \
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user