Answered by:
How do MSFT WinRT components raise Exceptions with explanation text?

Question
-
Like:
xception was thrown at line 401, column 7 in ms-appx://app/js/sync/serverCommunication.js 0x80070490 - JavaScript runtime error: Element not found. WinRT information: Cannot find credential in Vault If there is a handler for this exception, the program may be safely continued.
I am interested in raising this WinRT information myself, as the default COM error values not always fit the error I want to specify.
Wednesday, March 13, 2013 2:23 PM
Answers
-
Hi Phil,
They do not provide customer messages in the exception. That information is available only in the debugger.
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, March 13, 2013 2:55 PM
- Marked as answer by Yanping WangModerator Wednesday, March 20, 2013 6:46 AM
Wednesday, March 13, 2013 2:55 PMModerator -
This seems to work in Win8.1 finally!
throw ref new Platform::Exception("My text") will lead to a JS Exception object that has that text after 2 newlines in the "message" property.
Thanks for listening MSFT!- Marked as answer by phil_ke Monday, June 16, 2014 1:12 PM
Monday, June 16, 2014 1:12 PM
All replies
-
Hi Phil,
They do not provide customer messages in the exception. That information is available only in the debugger.
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Wednesday, March 13, 2013 2:55 PM
- Marked as answer by Yanping WangModerator Wednesday, March 20, 2013 6:46 AM
Wednesday, March 13, 2013 2:55 PMModerator -
This seems to work in Win8.1 finally!
throw ref new Platform::Exception("My text") will lead to a JS Exception object that has that text after 2 newlines in the "message" property.
Thanks for listening MSFT!- Marked as answer by phil_ke Monday, June 16, 2014 1:12 PM
Monday, June 16, 2014 1:12 PM