mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Handle 400 status from API
This commit is contained in:
@@ -110,6 +110,8 @@ func extractBody(response *http.Response) (string, error) {
|
|||||||
|
|
||||||
func handleError(response *http.Response, body string) error {
|
func handleError(response *http.Response, body string) error {
|
||||||
switch response.StatusCode {
|
switch response.StatusCode {
|
||||||
|
case 400:
|
||||||
|
return fmt.Errorf("Invalid request: %v", body)
|
||||||
case 404:
|
case 404:
|
||||||
return errors.New("Your client version is no longer supported. Please upgrade to the latest version.")
|
return errors.New("Your client version is no longer supported. Please upgrade to the latest version.")
|
||||||
case 413:
|
case 413:
|
||||||
|
|||||||
Reference in New Issue
Block a user