We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当前 Byzer 引擎执行脚本时,返回的报错信息大部分都是 stacktrace,可读性很差,用户无法获得具体信息
做一套基于 文本的配置模板的方式,能够让用户定义 key - value,其中 key 可以匹配 api 返回中的error message 的文本,将value中的文件进行替代返回,增强 API 错误信息的可读性
注意
byzer.properties
$BYZER_HOME/conf/err-msg-template.%{format}
MLSQL error
Byzer-lang error
The text was updated successfully, but these errors were encountered:
Byzer-lang 提供了 ExceptionRender 接口,新类实现该接口,并注册至 ExceptionRenderManager 。/run/script 接口返回错误信息前,调用 ExceptionRenderManager.call() 方法,该方法会自动调用各个注册的实现类。从而达到灵活扩展的目的。
ExceptionRender
ExceptionRenderManager
/run/script
ExceptionRenderManager.call()
配置文件: $BYZER_HOME/conf/err-msg-template.json json 格式:
$BYZER_HOME/conf/err-msg-template.json
[ { "regexp": "MLSQL Parser error in .*?", "msg": "MLSQL Parser error"} ]
修改点如下:
RestController
ExceptionRender 实现类主要逻辑:
DefaultExceptionRender
e.getMessage
regexp
msg
is_match(e: Exception): Boolean
ThreadLocal
Sorry, something went wrong.
chncaesar
No branches or pull requests
背景
当前 Byzer 引擎执行脚本时,返回的报错信息大部分都是 stacktrace,可读性很差,用户无法获得具体信息
需求
做一套基于 文本的配置模板的方式,能够让用户定义 key - value,其中 key 可以匹配 api 返回中的error message 的文本,将value中的文件进行替代返回,增强 API 错误信息的可读性
注意
byzer.properties
中可配置,默认为$BYZER_HOME/conf/err-msg-template.%{format}
, format 可以在技术实现中定义MLSQL error
, 统一替换为Byzer-lang error
The text was updated successfully, but these errors were encountered: