New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MYST-324 Return "Service Unavailable" when ipify is unavailable #166
Conversation
@@ -61,6 +64,7 @@ func (ce *connectionEndpoint) Create(resp http.ResponseWriter, req *http.Request | |||
case connection.ErrAlreadyExists: | |||
utils.SendError(resp, err, http.StatusConflict) | |||
default: | |||
log.Error(connectionLogPrefix, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not logs be handled in connection manager, and it it could have more detailed logs on intermediate steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least, we applied this approach in other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no convenient way to log all connect errors in connection manager - take a look at it's implementation:
func (manager *connectionManager) Connect(consumerID, providerID identity.Identity) error {
if manager.status.State != NotConnected {
return ErrAlreadyExists
}
proposal, err := manager.findProposalByProviderID(providerID)
if err != nil {
return err
}
dialogEstablisher := manager.newDialogEstablisher(consumerID)
manager.dialog, err = dialogEstablisher.EstablishDialog(providerID, proposal.ProviderContacts[0])
if err != nil {
return err
}
vpnSession, err := session.RequestSessionCreate(manager.dialog, proposal.ID)
if err != nil {
return err
}
manager.sessionID = vpnSession.ID
manager.openvpnClient, err = manager.newVpnClient(*vpnSession, consumerID, providerID, manager.onVpnStatusUpdate)
if err != nil {
manager.dialog.Close()
return err
}
if err := manager.openvpnClient.Start(); err != nil {
manager.dialog.Close()
return err
}
return nil
}
There are 6 places where error can occur - I want to log all of them, but adding 6 log statements just because this class did not have any logs before doesn't make sense to me.
No description provided.