diff --git a/src/ZM/global_functions.php b/src/ZM/global_functions.php index ee192f4c..21f1dc28 100644 --- a/src/ZM/global_functions.php +++ b/src/ZM/global_functions.php @@ -254,7 +254,8 @@ function ctx(): ContextInterface return ZMBuf::$context_class[$cid] ?? (ZMBuf::$context_class[$cid] = new $c_class($cid)); } } - throw new ZMKnownException(zm_internal_errcode('E00072') . 'Unable to find context environment'); + Console::warning('当前环境不是协程环境,将返回独立的非协程的容器'); + return ZMBuf::$context_class[$cid] ?? (ZMBuf::$context_class[$cid] = new $c_class($cid)); } /**