The reason is that the function is executed asynchronously, which means that
error handling is asynchronous as well.  Usually only argument type
validation will actually throw an exception.

To catch an error in the actual use of the API itself, check the value of
chrome.extension.lastError in your callback.

Erik

On Tue, Dec 15, 2009 at 11:27 PM, Drew <barfield2...@gmail.com> wrote:

> Hello,
>
> Is there any way to catch an exception from chrome.bookmarks.get() ?
>
> if I try:
>
>        try
>        {
>                chrome.bookmarks.get( bookmarkID, fnCallback );
>        }
>        catch(e)
>        {
>                console.log("Exception caught");
>        }
>
> ...the catch() block never executes even when the console displays an
> error message.
>
> I do know that on an exception the callback function's argument is
> undefined.
>
> Thank You!
> Drew
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@googlegroups.com.
> To unsubscribe from this group, send email to
> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to