File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,21 @@ function main(
5353 glossary : glossary ,
5454 } ;
5555
56- // Create glossary using a long-running operation.
57- // You can wait for now, or get results later.
58- const [ operation ] = await translationClient . createGlossary ( request ) ;
56+ // Create glossary using a long-running operation
57+ // and wait for its completion
58+ try {
59+ const [ operation ] = await translationClient . createGlossary ( request ) ;
5960
60- // Wait for operation to complete.
61- await operation . promise ( ) ;
61+ // Wait for operation to complete.
62+ await operation . promise ( ) ;
6263
63- console . log ( `Created glossary:` ) ;
64- console . log ( `InputUri ${ request . glossary . inputConfig . gcsSource . inputUri } ` ) ;
64+ console . log ( `Created glossary:` ) ;
65+ console . log (
66+ `InputUri ${ request . glossary . inputConfig . gcsSource . inputUri } `
67+ ) ;
68+ } catch ( error ) {
69+ console . error ( error . details ) ;
70+ }
6571 }
6672
6773 createGlossary ( ) ;
You can’t perform that action at this time.
0 commit comments