From 4dec1d70b8f4db8148cb64a6d6fc8738d402c28e Mon Sep 17 00:00:00 2001 From: Elara Musayelyan Date: Tue, 3 Jan 2023 16:47:25 -0800 Subject: [PATCH] Add error handling for RPC registration functions --- socket.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/socket.go b/socket.go index 91dc7b4..ff0fa60 100644 --- a/socket.go +++ b/socket.go @@ -67,14 +67,12 @@ func startSocket(ctx context.Context, dev *infinitime.Device) error { mux := drpcmux.New() - rpc.DRPCRegisterITD(mux, &ITD{ - dev: dev, - }) + err = rpc.DRPCRegisterITD(mux, &ITD{dev}) + if err != nil { + return err + } - rpc.DRPCRegisterFS(mux, &FS{ - dev: dev, - fs: fs, - }) + err = rpc.DRPCRegisterFS(mux, &FS{dev, fs}) if err != nil { return err }