-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
将 core 包模块化为子项目 morny-system-lib 或 morny-core,以增加共用可能性 #46
Comments
目前的计划是将
|
为实现这个迁移,目前
|
s"""Failed get updates: ${e.getMessage} | |
| server responses: | |
|${GsonBuilder().setPrettyPrinting().create.toJson(e.response).indent(4)} | |
|""".stripMargin | |
externalContext.consume[MornyReport](_.exception(e, "Failed get updates.")) |
Coeur-Morny-Cono/morny-coeur/src/main/scala/cc/sukazyo/cono/morny/core/MornyCoeur.scala
Lines 319 to 323 in e6b5fa5
case e_other => | |
logger `error` | |
s"""Failed get updates: | |
|${e_other.toLogString `indent` 3}""".stripMargin | |
externalContext.consume[MornyReport](_.exception(e_other, "Failed get updates.")) |
cc.sukazyo.cono.morny.core.bot.api.EventListenerManager
对于事件监听器抛出的异常的处理,为了向 Telegram 端报告错误而依赖了 MornyReport:
Lines 84 to 95 in e6b5fa5
val errorMessage = StringBuilder() | |
errorMessage ++= "Event throws unexpected exception:\n" | |
errorMessage ++= (e.toLogString `indent` 4) | |
e match | |
case actionFailed: EventRuntimeException.ActionFailed => | |
errorMessage ++= "\ntg-api action: response track: " | |
errorMessage ++= (GsonBuilder().setPrettyPrinting().create().toJson( | |
actionFailed.response | |
) `indent` 4) ++= "\n" | |
case _ => | |
logger `error` errorMessage.toString | |
coeur.externalContext.consume[MornyReport](_.exception(e, "on event running")) |
这一部分可以通过添加
可以通过添加 这几个名称目前都只是暂定,可能会随着未来事件系统的进一步设计和完善而改变。 |
目前预计可以将这个完全在一起的项目分离为以下几个部分:
morny-system-lib
或morny-core
: 包含 MornyCoeur 关键系统以及 SystemMain, ModuleLoader 等入口点,以及 bot, http, log 等公共 API 部分,可以被完全重用。也可能包含 MornyReports, MornyInformation, MornyManagers 等非关键系统但是仍然有比较高的可重用价值的部分,这一部分也可能会重新分更细粒度的包。morny-coeur
: 包含目前 Morny 的所有功能实现,但是没有关键系统组件。The text was updated successfully, but these errors were encountered: