Skip to content

2.0.0: Merge pull request #256 from onerain88/200

Compare
Choose a tag to compare
@github-actions github-actions released this 13 Jul 03:11
· 70 commits to master since this release
1b1ac95

Breaking changes

  • 云引擎: 修复云引擎在云函数中通过 LCEngineRequestContext 获取 RemoteAddress,SessionToken 错误
  • 云引擎: 改进云引擎日志输出,增加云引擎异常 LCEngineException

Improvements

  • 云引擎: 重构云引擎 RTM Hook 模块

如何升级

LCEngineRequestContext

如果之前没有使用 LCEngineRequestContext,则无需调整。
如果之前有使用 LCEngineRequestContext,则需要在云函数/Hook 的函数声明中增加 LCEngineRequestContext 参数,之前通过 LCEngineRequestContext 获取 SessionToken 的方式调整为通过 LCEngineRequestContext 参数获取,如:

[LCEngineFunction("hello")]
public static async Task<string> Hello(LCEngineRequestContext context) {
  Console.WriteLine($"{context.SessionToken} says hello from {context.RemoteAddress}");
}

LCEngineException

之前通过 LCException 表示云引擎自定义异常,导致无法处理云函数运行时调用云存储接口抛出的异常。
所以,从 2.0.0 版本后,请使用 LCEngineException 表示云引擎自定义异常,对应 4xx 错误。