errorHandler parses errors from the body Errors seem to be HTML with containing the error text Can not move sync folder.
(resp *http.Response)
| 504 | // Errors seem to be HTML with <h3> containing the error text |
| 505 | // <h3>Can not move sync folder.</h3> |
| 506 | func errorHandler(resp *http.Response) (err error) { |
| 507 | body, err := rest.ReadBody(resp) |
| 508 | if err != nil { |
| 509 | return fmt.Errorf("error reading error out of body: %w", err) |
| 510 | } |
| 511 | match := findError.FindSubmatch(body) |
| 512 | if len(match) < 2 || len(match[1]) == 0 { |
| 513 | return fmt.Errorf("HTTP error %v (%v) returned body: %q", resp.StatusCode, resp.Status, body) |
| 514 | } |
| 515 | return fmt.Errorf("HTTP error %v (%v): %s", resp.StatusCode, resp.Status, match[1]) |
| 516 | } |
| 517 | |
| 518 | // rootSlash returns root with a slash on if it is empty, otherwise empty string |
| 519 | func (f *Fs) rootSlash() string { |
searching dependent graphs…