Commit 30a6887 1 parent 24629c9 commit 30a6887 Copy full SHA for 30a6887
File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export class Channel {
29
29
await this . redisService . setWithExpiry (
30
30
`cache:${ channelId } ` ,
31
31
JSON . stringify ( channel ) ,
32
- options . expiry ,
32
+ options ? .expiry ,
33
33
) ;
34
34
35
35
return channel ;
Original file line number Diff line number Diff line change @@ -24,11 +24,12 @@ export class Guild {
24
24
}
25
25
26
26
const guild = await this . guildService . getGuildById ( guildId ) ;
27
+ if ( guild . err ) return guild ;
27
28
28
29
await this . redisService . setWithExpiry (
29
30
`cache:${ guildId } ` ,
30
31
JSON . stringify ( guild ) ,
31
- options . expiry ,
32
+ options ? .expiry ,
32
33
) ;
33
34
34
35
return guild ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class Member {
37
37
await this . redisService . setWithExpiry (
38
38
`cache:${ guildId } -${ memberId } ` ,
39
39
JSON . stringify ( guildMember ) ,
40
- options . expiry ,
40
+ options ? .expiry ,
41
41
) ;
42
42
43
43
return guildMember ;
Original file line number Diff line number Diff line change @@ -36,15 +36,18 @@ export class DiscordRateLimiter {
36
36
const err = error as AxiosError ;
37
37
38
38
if ( err . response . data ) {
39
- console . log ( err . response , 'API ERROR' ) ;
40
-
41
39
if ( err . status === 429 && axiosConfig . endpointType ) {
42
40
this . updateRateLimits ( axiosConfig . endpointType , err . response . headers ) ;
43
41
this . executeRequest ( axiosConfig ) ;
44
42
}
45
- } else {
46
- console . log ( err , 'Error' ) ;
47
43
}
44
+
45
+ return {
46
+ error : {
47
+ status : err . response ?. status ,
48
+ data : err . response . data ,
49
+ } ,
50
+ } ;
48
51
}
49
52
}
50
53
You can’t perform that action at this time.
0 commit comments