When checking if the app is already linked, we use the following condition:
if scerr, ok := errors.ErrgoRoot(err).(*http.RequestFailedError); ok || (ok && scerr.Code != 404) {
return errgo.Notef(err, "fail to get the integration link for this app")
}
Howerver if there is a 404 error (which is likely since the app should not be linked), err will be something like:
&http.RequestFailedError{
Code: 404
}
So ok will be true.
Since the condition for failure is:
ok || (ok && scerr.Code != 404)
This will be true || false => true and we will fail.
The text was updated successfully, but these errors were encountered:
When checking if the app is already linked, we use the following condition:
Howerver if there is a 404 error (which is likely since the app should not be linked), err will be something like:
So ok will be true.
Since the condition for failure is:
This will be
true || false
=> true and we will fail.The text was updated successfully, but these errors were encountered: