Check for response status when fetching credentials
This commit is contained in:
parent
168b33d5d5
commit
0aff72059b
@ -84,6 +84,11 @@ func ConnectWithBackend(c *gin.Context) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
c.JSON(400, Error{"Unable to fetch connection settings"})
|
||||
return
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
c.JSON(400, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user