Skip to content

Commit b21bb7c

Browse files
committed
Define helper macros for handling exceptions
This includes one for discarding thrown exceptions, and another for printing their stack trace to `System.err`.
1 parent 4da105e commit b21bb7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ch_usi_si_seart_treesitter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ extern "C" {
184184
#define _getClass(NAME) \
185185
env->FindClass(NAME)
186186

187+
#define _clearException() \
188+
env->ExceptionClear()
189+
190+
#define _describeException() \
191+
env->ExceptionDescribe()
192+
187193
#define _loadClass(VARIABLE, NAME) \
188194
{ \
189195
jclass local = _getClass(NAME); \

0 commit comments

Comments
 (0)