However, during the development process, it can be useful to
get richer error information. Retrieving this error information
requires some scripting. This can be done by catching exceptions
thrown by the call. In the preceding example, this was
done with the following try/catch block. If an error occurs, an
exception is thrown, and a message box will pop up with the
corresponding error number.
try
{
token.value = card.value;
} catch (e)
{
Alert("error:" + e.number);
}
Of course, this method of error handling is just an example, but
it demonstrates how the error code can be retrieved.
In addition to CardSpace displaying some error messages, and
in other cases returning error codes, Internet Explorer will sometimes
redirect to an embedded resource page. These are the
three main error-handling strategies used by CardSpace.
When calling
CardSpace from a
script it is possible
to get error codes
There are several
possible error
conditions
Using CardSpace in the Browser 235
Here are the most common errors that can occur, and how they
are handled:
User Cancelled. This is probably the most common error;
it happens when a user cancels out of CardSpace
instead of choosing a card.
Pages:
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358