From ee63b3a808171455d65bb3f45e4cb5e02a62efb3 Mon Sep 17 00:00:00 2001 From: naiba Date: Mon, 3 Mar 2025 22:56:48 +0800 Subject: [PATCH] chore: handle errors in ReportSystemInfo methods --- service/rpc/nezha.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service/rpc/nezha.go b/service/rpc/nezha.go index 5eb9b99..6eb8998 100644 --- a/service/rpc/nezha.go +++ b/service/rpc/nezha.go @@ -155,12 +155,16 @@ func (s *NezhaHandler) onReportSystemInfo(c context.Context, r *pb.Host) error { } func (s *NezhaHandler) ReportSystemInfo(c context.Context, r *pb.Host) (*pb.Receipt, error) { - s.onReportSystemInfo(c, r) + if err := s.onReportSystemInfo(c, r); err != nil { + return nil, err + } return &pb.Receipt{Proced: true}, nil } func (s *NezhaHandler) ReportSystemInfo2(c context.Context, r *pb.Host) (*pb.Uint64Receipt, error) { - s.onReportSystemInfo(c, r) + if err := s.onReportSystemInfo(c, r); err != nil { + return nil, err + } return &pb.Uint64Receipt{Data: singleton.DashboardBootTime}, nil }