I am working on translating the functionality of this C code into TypeScript. The main goal of this piece of code is to streamline error checking, inspired by JPL's The Power of Ten principles. I have been struggling to implement this in TS.
#define ecall(retVal, l_call, format, ...) do { \
int _rv = (l_call); \
if(_rv < 0) { \
console.log(format, __VA_ARGS__); \
return retVal; \
} \
else { \
verify(); \
} \
} while(0)