The C API will currently abort after catching a panic, for safety reasons. However, we shouldn't abort, but rather catch it and return an error code.