mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-26 01:23:13 +01:00
fix: replace panic calls with proper error handling
Remove 51 panic() calls from handler code and replace with: - Proper error logging using zap - Appropriate client error responses (doAckBufFail, doAckSimpleFail) - Graceful error recovery instead of server crashes Files updated: - handlers_guild_scout.go (9 panics) - handlers_guild_tresure.go (10 panics) - handlers_guild.go (7 panics + dead code removal) - handlers_mail.go (5 panics) - handlers.go (9 panics) - handlers_tower.go (2 panics) - handlers_clients.go (3 panics) - handlers_guild_alliance.go (1 panic) - handlers_quest.go (1 panic) - handlers_rengoku.go (1 panic) - handlers_stage.go (1 panic) - handlers_data.go (1 panic) - handlers_cafe.go (1 panic) - signserver/sign_server.go (1 panic) Remaining panics (3) are in test files and compression library where panicking on programming errors is appropriate.
This commit is contained in:
@@ -112,7 +112,9 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
||||
if _, err := os.Stat(filepath.Join(s.server.erupeConfig.BinPath, "quest_override.bin")); err == nil {
|
||||
data, err := os.ReadFile(filepath.Join(s.server.erupeConfig.BinPath, "quest_override.bin"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
s.logger.Error("failed to read quest_override.bin", zap.Error(err))
|
||||
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 0))
|
||||
return
|
||||
}
|
||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user