Loading ...
Sorry, an error occurred while loading the content.

Re: catch (exception) fails

Expand Messages
  • aceblchboy
    ... I believe the goal of this rule is to make it easier to identify exactly where the error is happening, and there s no shame in numbering. I also prefix
    Message 1 of 2 , Aug 4, 2012
    View Source
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Daniel" <dmorilha@...> wrote:
      >
      > In the case I repeat the same identifier on a catch block I receive an "'identifier' is already defined" error message.
      >
      > try {
      > } catch (exception) {
      > }
      >
      > ...
      >
      > try {
      > } catch (exception) {
      > }
      >
      > Is this a bug? If not why I can't use the same 'exception' or 'e' for all my catch blocks?
      >
      > As a good engineer I run out of creativity for identifiers and start appending numeric suffixes on all exception identifiers.
      >
      > thanks,
      >

      I believe the goal of this rule is to make it easier to identify exactly where the error is happening, and there's no shame in numbering. I also prefix with what the scope is as well. fooE1, barE1, barE2 etc. It makes it easier to pick out the error handler to watch.
    Your message has been successfully submitted and would be delivered to recipients shortly.