@@ -55,7 +55,7 @@ func (gc *GraphClient) ReadCurrentGraph() (*knowledge.Graph, error) {
55
55
if res .StatusCode == http .StatusUnauthorized {
56
56
return nil , fmt .Errorf ("Unauthorized access. Check your auth token" )
57
57
} else if res .StatusCode != http .StatusOK {
58
- return nil , fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
58
+ return nil , fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
59
59
}
60
60
61
61
b , err := ioutil .ReadAll (res .Body )
@@ -98,7 +98,7 @@ func (gc *GraphClient) UpdateSchema(sg schema.SchemaGraph) error {
98
98
} else if res .StatusCode == http .StatusTooManyRequests {
99
99
return ErrTooManyRequests
100
100
} else if res .StatusCode != http .StatusOK {
101
- return fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
101
+ return fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
102
102
}
103
103
return nil
104
104
}
@@ -130,7 +130,7 @@ func (gc *GraphClient) UpsertAsset(asset knowledge.Asset) error {
130
130
} else if res .StatusCode == http .StatusTooManyRequests {
131
131
return ErrTooManyRequests
132
132
} else if res .StatusCode != http .StatusOK {
133
- return fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
133
+ return fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
134
134
}
135
135
return nil
136
136
}
@@ -162,7 +162,7 @@ func (gc *GraphClient) DeleteAsset(asset knowledge.Asset) error {
162
162
} else if res .StatusCode == http .StatusTooManyRequests {
163
163
return ErrTooManyRequests
164
164
} else if res .StatusCode != http .StatusOK {
165
- return fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
165
+ return fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
166
166
}
167
167
return nil
168
168
}
@@ -194,7 +194,7 @@ func (gc *GraphClient) UpsertRelation(relation knowledge.Relation) error {
194
194
} else if res .StatusCode == http .StatusTooManyRequests {
195
195
return ErrTooManyRequests
196
196
} else if res .StatusCode != http .StatusOK {
197
- return fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
197
+ return fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
198
198
}
199
199
return nil
200
200
}
@@ -226,7 +226,7 @@ func (gc *GraphClient) DeleteRelation(relation knowledge.Relation) error {
226
226
} else if res .StatusCode == http .StatusTooManyRequests {
227
227
return ErrTooManyRequests
228
228
} else if res .StatusCode != http .StatusOK {
229
- return fmt .Errorf ("Expected status code 200 and got %d" , res .StatusCode )
229
+ return fmt .Errorf ("Expected status code 200 and got %d: %s " , res .StatusCode , res . Status )
230
230
}
231
231
return nil
232
232
}
0 commit comments