Function TVMFFIErrorCreate#
Defined in File c_api.h
Function Documentation#
-
int TVMFFIErrorCreate(const TVMFFIByteArray *kind, const TVMFFIByteArray *message, const TVMFFIByteArray *backtrace, TVMFFIObjectHandle *out)#
Create an initial error object.
Note
This function is different from other functions as it is used in the error handling loop. So we do not follow normal error handling patterns. When error happens it will not set the error in TLS (since TLS error setting also involves creating an Error object). Instead, caller should simply report MemoryError to the logger.
- Parameters:
kind – The kind of the error.
message – The error message.
backtrace – The backtrace of the error.
out – The output error object handle.
- Returns:
0 on success, nonzero on failure(likely MemoryError)