Strange error in for() {try...catch...} block. - Mozilla

This is a discussion on Strange error in for() {try...catch...} block. - Mozilla ; Hi, there, I have a piece of code ( http://pastebin.mozilla.org/362631 ) which suppose to save user login information from an array to firefox's password storage. Well, I think the 'for() {try...catch...}' should be able to go through all items in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Strange error in for() {try...catch...} block.

  1. Strange error in for() {try...catch...} block.

    Hi, there,

    I have a piece of code (http://pastebin.mozilla.org/362631) which
    suppose to save user login information from an array to firefox's
    password storage.

    Well, I think the 'for() {try...catch...}' should be able to go
    through all items in that array, try to save the data, and loop to
    next no matter what happens to current one. But the truth is that
    it'll quit the loop when the first exception is caught. (On ff3,
    there's an exception if user login already exists.)

    Any idea to make it work?

    Thanks.
    Calvin

  2. Re: Strange error in for() {try...catch...} block.

    Calvin Liu wrote:
    > Hi, there,
    >
    > I have a piece of code (http://pastebin.mozilla.org/362631) which
    > suppose to save user login information from an array to firefox's
    > password storage.
    >
    > Well, I think the 'for() {try...catch...}' should be able to go through
    > all items in that array, try to save the data, and loop to next no
    > matter what happens to current one. But the truth is that it'll quit the
    > loop when the first exception is caught. (On ff3, there's an exception
    > if user login already exists.)
    >
    > Any idea to make it work?
    >
    > Thanks.
    > Calvin



    I would bet on either Fx3 being broken (not very likely, but possible)
    or the code in your catch block breaking. Did you check for exceptions?

    ~ Gijs

+ Reply to Thread