check status on upload, query escape cities for formatting maps uri format
This commit is contained in:
@@ -119,6 +119,11 @@ func (m Matrix) SendImage(uri string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if response.StatusCode != http.StatusOK {
|
||||
b, _ := ioutil.ReadAll(response.Body)
|
||||
response.Body.Close()
|
||||
return fmt.Errorf("failed to get %s: (%d) %s", uri, response.StatusCode, b)
|
||||
}
|
||||
b, err := ioutil.ReadAll(response.Body)
|
||||
response.Body.Close()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user