Skip to content

Commit

Permalink
fix: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jan 19, 2024
1 parent 3eac2f7 commit 729cb78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wails_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ func (a *WailsApp) WailsRequestRouter(route string, method string, body string)
}).Errorf("Failed to decode request to wails router: %v", err)
return WailsRequestRouterResponse{Body: nil, Error: err.Error()}
}
a.svc.Setup(setupRequest)
err = a.svc.Setup(setupRequest)
if err != nil {
a.svc.Logger.WithFields(logrus.Fields{
"route": route,
"method": method,
"body": body,
}).Errorf("Failed to setup node: %v", err)
return WailsRequestRouterResponse{Body: nil, Error: err.Error()}
}
return WailsRequestRouterResponse{Body: nil, Error: ""}
}
a.svc.Logger.Errorf("Unhandled route: %s", route)
Expand Down

0 comments on commit 729cb78

Please sign in to comment.