File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
pkg/streamcontrol/youtube Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ package youtube
2
2
3
3
import (
4
4
"context"
5
+ "errors"
5
6
"fmt"
6
7
"io"
8
+ "net/http"
7
9
8
10
"github.com/facebookincubator/go-belt/tool/logger"
9
11
"google.golang.org/api/googleapi"
@@ -116,7 +118,17 @@ func (c *YouTubeClientV3) Ping(
116
118
) (_err error ) {
117
119
logger .Tracef (ctx , "Ping" )
118
120
defer func () { logger .Tracef (ctx , "/Ping: %v" , _err ) }()
119
- return wrapRequestS (ctx , c .RequestWrapper , c .I18nLanguages .List (nil ).Context (ctx ).Do )
121
+ err := wrapRequestS (ctx , c .RequestWrapper , c .I18nLanguages .List (nil ).Context (ctx ).Do )
122
+ gErr := & googleapi.Error {}
123
+ if err != nil && errors .As (err , & gErr ) {
124
+ if gErr .Code == http .StatusForbidden && len (gErr .Errors ) == 1 {
125
+ gErrItem := gErr .Errors [0 ]
126
+ if gErrItem .Reason == "quotaExceeded" { // this is not an authentication or/and connection problem.
127
+ return nil
128
+ }
129
+ }
130
+ }
131
+ return err
120
132
}
121
133
122
134
func (c * YouTubeClientV3 ) GetBroadcasts (
You can’t perform that action at this time.
0 commit comments