int errorCode = (int)function(gribHandle, key, __VA_ARGS__); \
const int errorCode = (int)function(gribHandle, key, __VA_ARGS__); \
if(errorCode)\
{\
fprintf(stderr, "%s:%d: Error in function `%s`: `%s` returned error code %d for key \"%s\"", __FILE__, __LINE__, __func__, #function, errorCode, key);\