File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,15 @@ const __main__ = async (intervalHours: number) => {
26
26
const q = `艦これウィジェット OR #艦これウィジェット OR #編成キャプチャ -from:KanColleWidget -RT since:${ since } ` ;
27
27
console . log ( "[INFO]" , q ) ;
28
28
const params = { q } ;
29
- const { statuses } = await client . get ( "search/tweets" , params ) ;
29
+ let statuses = [ ] ;
30
+ try {
31
+ const res = await client . get ( "search/tweets" , params ) ;
32
+ statuses = res . statuses ;
33
+ } catch ( err ) {
34
+ console . log ( "[ERROR]" , err ) ;
35
+ // FIXME: process.exit(1); // ひとまずTwitterAPI対応できるまでエラーは無視
36
+ return ;
37
+ }
30
38
console . log ( "[INFO]" , "FOUND" , statuses . length ) ;
31
39
for ( let i = 0 ; i < statuses . length ; i ++ ) {
32
40
const status = statuses [ i ] ;
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ if (require.main == module) {
15
15
console . log ( `Tweet:\thttps://twitter.com/${ tweet . user . screen_name } /statuses/${ tweet . id_str } \nStatus:\t${ status } ` ) ;
16
16
process . exit ( 0 ) ;
17
17
} ) . catch ( err => {
18
- console . error ( "Error:" , err ) ;
19
- process . exit ( 1 ) ;
18
+ console . log ( "[ERROR]" , err ) ;
19
+ console . log ( "[DEBUG]" , "ツイート内容:\t" , status ) ;
20
+ // FIXME: process.exit(1); // ひとまずTwitterAPI対応できるまでエラーは無視
20
21
} ) ;
21
22
}
You can’t perform that action at this time.
0 commit comments