Comment 9 for bug 1370115

Revision history for this message
Calvin Metcalf (calvin-metcalf) wrote : Re: [Bug 1370115] Re: un needed try/catch blocks

Your probably going to want to do a regex on the message or you could
consider it a range error (it's out side the range of times it can be
called)
On Sep 17, 2014 7:31 AM, "Marten de Vries" <email address hidden> wrote:

> Good point. Setting err.message and then throw(err);-ing again instead
> of creating a new Error object should be no problem. Result would be
> something like:
>
> try {
> //method call
> } catch (err) {
> if (err.name === "Error" /* && maybe another check, need to check the
> source for that */) {
> err.message = "Security methods already installed"; //or something
> similar
> }
> throw(err);
> }
>
> Is that ok with you considering the above?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1370115
>
> Title:
> un needed try/catch blocks
>
> Status in Python-PouchDB:
> Triaged
>
> Bug description:
> the try catch blocks in security here https://bazaar.launchpad.net
> /~marten-de-vries/python-pouchdb/0.x/view/head:/js/pouchdb-
> security/index.js#L31 and here https://bazaar.launchpad.net/~marten-
> de-vries/python-pouchdb/0.x/view/head:/js/pouchdb-
> security/index.js#L40 simply listen for errors that they then rethrow.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/python-pouchdb/+bug/1370115/+subscriptions
>