Comments (6)
这不是报错。 你看你main文件,例子中把err panic 了
from jupiter.
退出的错误信息显示不太友好,可以优化一下体验
from jupiter.
退出的错误信息显示不太友好,可以优化一下体验
现在 gin 的example 和 echo 的example 是保持一致的
https://github.com/douyu/jupiter/blob/master/example/http/simple/main.go#L27
https://github.com/douyu/jupiter/blob/master/example/http/gin/main.go#L27
把错误级别由Panic调整成Error ,如下?
//把
xlog.Panic(err.Error())
//调整为:
xlog.Error(err.Error())
形成如下提示:
这样调整?
还是从从根本上能区分出主动关闭,即主动关闭时候 仍然抛出 info信息?
from jupiter.
@mlboy 我的想法是识别Server Closed错误,然后结合上下文优化一下抛错误的体验。
有些发布、监控系统会监听错误输出和退出码,Error/Panic的方式都不优雅。
2d1b7c2 简单的屏蔽了ServerClosed/ServerStop错误。后面考虑更优雅的方案
from jupiter.
退出的错误信息显示不太友好,可以优化一下体验
没注意看 gin 例子中的是 xlog.panic ,以为是退出的某个环节内部 panic 了, 这个是调用方主动将 err panic 了, 那这个报错也正常, 我的锅 😭
from jupiter.
@mlboy 我的想法是识别Server Closed错误,然后结合上下文优化一下抛错误的体验。
有些发布、监控系统会监听错误输出和退出码,Error/Panic的方式都不优雅。2d1b7c2 简单的屏蔽了ServerClosed/ServerStop错误。后面考虑更优雅的方案
嗯,另外有个问题就是:非主动退出时,无法感知server close行为。服务常态是一直运行,在退出时候能感知到服务的状态变化。在主动关闭时,多收到一个通知,会比没有通知好点。
from jupiter.
Related Issues (20)
- feat: refactor jupiter new like gonew HOT 1
- 一些关于官网文档的小意见
- Go install toolkit ERROR? How to fix it? HOT 2
- feat: support sentinel for server and client HOT 1
- Bug:panic of variable "span" rocketmq PushConsumer when EnableTrace is not set. HOT 1
- feat: support convert protobuf enum to error HOT 1
- feat: support clickhouse client HOT 1
- release: v0.9.11 HOT 1
- feat: support table store client HOT 1
- feat: support auto complete for rocketmq addr config
- "Unable to locate build via Github Actions API" for the public repository HOT 3
- feat(cmd): support generate echo route based on protobuf HOT 1
- feat: all client Intruction support Must(Build/Singleton) API based on lo.Must. HOT 1
- feat: support release protoc-gen-go-echo/gin/xerror HOT 1
- opti: RestrictParallel execution optimization HOT 1
- config.toml不知道怎么用
- create方法传入slice报Error: reflect: call of reflect.Value.Interface on zero Value HOT 4
- feat: use docker instead of request httpbin directly HOT 1
- feat: log support change level dynamically HOT 7
- where is deployment/docker-compose.yml ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupiter.