File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
connectors/src/connectors/github/temporal Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change
1
+ import { RequestError } from "@octokit/types" ;
1
2
import {
2
3
ActivityExecuteInput ,
3
4
ActivityInboundCallsInterceptor ,
4
5
Next ,
5
6
} from "@temporalio/worker" ;
6
-
7
7
export class GithubCastKnownErrorsInterceptor
8
8
implements ActivityInboundCallsInterceptor
9
9
{
@@ -14,25 +14,15 @@ export class GithubCastKnownErrorsInterceptor
14
14
try {
15
15
return await next ( input ) ;
16
16
} catch ( err : unknown ) {
17
- const maybeGhError = err as {
18
- status ?: number ;
19
- name ?: string ;
20
- type ?: string ;
21
- } ;
17
+ const maybeGhError = err as RequestError ;
22
18
23
- if (
24
- maybeGhError . status === 403 &&
25
- maybeGhError . type === "RequestError" &&
26
- maybeGhError . name === "HttpError"
27
- ) {
19
+ if ( maybeGhError . status === 403 && maybeGhError . name === "HttpError" ) {
28
20
throw {
29
21
__is_dust_error : true ,
30
22
message : "Github rate limited" ,
31
23
type : "github_rate_limited" ,
32
24
} ;
33
25
}
34
-
35
- throw err ;
36
26
}
37
27
}
38
28
}
You can’t perform that action at this time.
0 commit comments