Code review comment for lp:~adiroiban/launchpad/bug-540105

Revision history for this message
Adi Roiban (adiroiban) wrote :

I added try/catch statements.

Many thanks for your review.

Do you have time to send this branch to ec2 test and land, or should I ask the ORC?

Here is the latest diff.
=== modified file 'lib/lp/translations/templates/pofile-translate.pt'
--- lib/lp/translations/templates/pofile-translate.pt 2010-03-17 23:17:46 +0000
+++ lib/lp/translations/templates/pofile-translate.pt 2010-03-18 16:26:48 +0000
@@ -18,12 +18,28 @@
       registerLaunchpadFunction(insertAllExpansionButtons);

       LPS.use('lp.pofile', function(Y) {
+ try {
           Y.on('domready', Y.lp.pofile.updateNotificationBox);
+ } catch (e) {
+ Y.log(e, "error");
+ }
+ try {
           Y.on('domready', Y.lp.pofile.setupSuggestionDismissal);
+ } catch (e) {
+ Y.log(e, "error");
+ }
+ try {
           Y.on('domready', Y.lp.pofile.initializeKeyBindings);
+ } catch (e) {
+ Y.log(e, "error");
+ }
+ try {
           Y.on('domready', function(e) {
             Y.lp.pofile.setFocus(autofocus_field);
           });
+ } catch (e) {
+ Y.log(e, "error");
+ }
       });

=== modified file 'lib/lp/translations/templates/translationmessage-translate.pt'
--- lib/lp/translations/templates/translationmessage-translate.pt 2010-03-17 23:17:46 +0000
+++ lib/lp/translations/templates/translationmessage-translate.pt 2010-03-18 16:25:45 +0000
@@ -15,11 +15,23 @@
     </style>
     <script type="text/javascript">
       LPS.use('node', 'lp.pofile', function(Y) {
+ try {
           Y.on('domready', Y.lp.pofile.setupSuggestionDismissal);
+ } catch (e) {
+ Y.log(e, "error");
+ }
+ try {
           Y.on('domready', Y.lp.pofile.initializeKeyBindings);
+ } catch (e) {
+ Y.log(e, "error");
+ }
+ try {
           Y.on('domready', function(e) {
             Y.lp.pofile.setFocus(autofocus_field);
           });
+ } catch (e) {
+ Y.log(e, "error");
+ }
       });
     </script>
     </div>

« Back to merge proposal