From d95a5131f6e9174a32c584c3d3e86720ff00f638 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 30 Apr 2022 13:38:15 +0800 Subject: [PATCH] remove ctx function throw exception --- src/ZM/global_functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); } /**