fix(recovery):panic serving interface conversion #644
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
2024/06/12 22:27:36 http: panic serving [::1]:3062: interface conversion: interface {} is nil, not *zap.Logger goroutine 77 [running]: net/http.(*conn).serve.func1() net/http/server.go:1868 +0xb9 panic({0x20f3be0?, 0xc0005286f0?}) runtime/panic.go:920 +0x270 github.com/iyear/tdl/pkg/logger.From(...) github.com/iyear/tdl/pkg/logger/logger.go:14 github.com/iyear/tdl/pkg/recovery.(*recovery).Handle.func1({0x2695ce8, 0xc00004a9c0}, {0x26897c0?, 0xc0005286c0}, {0x26897e0?, 0xc000476680}) github.com/iyear/tdl/pkg/recovery/recovery.go:32 +0x189 github.com/gotd/td/telegram.InvokeFunc.Invoke(0x30?, {0x2695ce8?, 0xc00004a9c0?}, {0x26897c0?, 0xc0005286c0?}, {0x26897e0?, 0xc000476680?}) github.com/gotd/td@v0.102.0/telegram/middleware.go:15 +0x47 github.com/gotd/td/tg.(*Client).UploadGetFile(0xc000476380, {0x2695ce8, 0xc00004a9c0}, 0x34063ac?) github.com/gotd/td@v0.102.0/tg/tl_upload_get_file_gen.go:341 +0x70 github.com/gotd/contrib/tg_io.chunkSource.Chunk({{0x26a6558?, 0xc0000bf380?}, 0xc000476380?, 0x0?}, {0x2695ce8, 0xc00004a9c0}, 0x0, {0xc0006e2000, 0x80000, 0x80000}) github.com/gotd/contrib@v0.20.0/tg_io/download.go:51 +0xd2 github.com/gotd/contrib/partio.Streamer.safeRead({0x2695ce8?, {0x2688740?, 0xc00025a340?}}, {0x2695ce8?, 0xc00004a9c0?}, 0xc19289f61a265e98?, {0xc0006e2000?, 0x80000, 0x1a53dcd59?}) github.com/gotd/contrib@v0.20.0/partio/streamer.go:37 +0x54
当运行 .\tdl.exe dl -u https://t.me/xxxx/xxxx --serve 的时候访问链接出现崩溃。此pr 可以修复这个崩溃