Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
fix(targets): handle 502 as target unavailable (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-rots authored Feb 25, 2021
1 parent e8f0351 commit 35464a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion targets/emby/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c apiClient) do(req *http.Request) (*http.Response, error) {
switch res.StatusCode {
case 401:
return nil, fmt.Errorf("invalid emby token: %s: %w", res.Status, autoscan.ErrFatal)
case 404, 500, 503, 504:
case 404, 500, 502, 503, 504:
return nil, fmt.Errorf("%s: %w", res.Status, autoscan.ErrTargetUnavailable)
default:
return nil, fmt.Errorf("%s: %w", res.Status, autoscan.ErrFatal)
Expand Down
2 changes: 1 addition & 1 deletion targets/plex/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c apiClient) do(req *http.Request) (*http.Response, error) {
switch res.StatusCode {
case 401:
return nil, fmt.Errorf("invalid plex token: %s: %w", res.Status, autoscan.ErrFatal)
case 404, 500, 503, 504:
case 404, 500, 502, 503, 504:
return nil, fmt.Errorf("%s: %w", res.Status, autoscan.ErrTargetUnavailable)
default:
return nil, fmt.Errorf("%s: %w", res.Status, autoscan.ErrFatal)
Expand Down

0 comments on commit 35464a7

Please sign in to comment.