As this is a function for funcatexit. It need be pickled into env. So we can not add error.context here. But thanks for your advice.