Calling a YarnFn can fail in several ways. Currently they all panic which is probably alright since they are all (I think) unrecoverable from the runtime's perspective. However panicing inside the YarnFn impl means that there isn't enough information available to emit useful error messages. In particular the YarnFn does not know what name it is bound to in yarn. I think we should instead return Result and then the VirtualMachine can unwrap that and add context to the error message if necessary.
Calling a
YarnFncan fail in several ways. Currently they all panic which is probably alright since they are all (I think) unrecoverable from the runtime's perspective. However panicing inside theYarnFnimpl means that there isn't enough information available to emit useful error messages. In particular theYarnFndoes not know what name it is bound to in yarn. I think we should instead returnResultand then theVirtualMachinecan unwrap that and add context to the error message if necessary.