Check the return value of C API call This function will raise exception when error occurs. Wrap every API call with this function Parameters ---------- ret : int return value from API calls
(ret)
| 56 | # helper function in ctypes. |
| 57 | # ---------------------------- |
| 58 | def check_call(ret): |
| 59 | """Check the return value of C API call |
| 60 | |
| 61 | This function will raise exception when error occurs. |
| 62 | Wrap every API call with this function |
| 63 | |
| 64 | Parameters |
| 65 | ---------- |
| 66 | ret : int |
| 67 | return value from API calls |
| 68 | """ |
| 69 | if ret != 0: |
| 70 | raise DGLError(py_str(_LIB.DGLGetLastError())) |
| 71 | |
| 72 | |
| 73 | def c_str(string): |
no test coverage detected