WCF RIA 服务和Silverlight:自定义异常消息 + x 的加载操作失败

发布于 2024-10-10 10:43:41 字数 239 浏览 0 评论 0原文

因此,在服务器上,我发回自定义异常消息,旨在向用户显示(认为“错误的用户名/密码”、“帐户已被锁定”等)

但是,当我在 silverlight 中查看异常消息时,它带有前缀与“x 的加载操作失败”。我认为 Exception.InnerException 是放置原始异常的好地方,但我猜 RIA 团队不同意。

有没有办法获取我原来的异常消息?当然,我可以编写一个快速的正则表达式来解析它,但这感觉很脏......这是我唯一的选择吗?

So on the server I send back custom exception messages, meant to be displayed to the user (think "Bad Username/Password", "Account has been locked out" etc.)

However, when I view the Exception message in silverlight it is prefixed with "Load operation failed for x." I was thinking that Exception.InnerException would be a good place to put the original Exception, but I guess the RIA team didn't agree.

Is there a way to get my original exception message? Sure, I could write a quick regex to parse it out, but that feels dirty... Is that my only option?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海未深 2024-10-17 10:43:41

我读到了一个可能适合您的解决方案。不过我自己还没有实现它。

http://mark. mymonster.nl/2011/02/10/make-use-of-wcf-faultcontracts-in-silverlight-clients/

I read about a solution that may work for you. I have yet to implement it myself though.

http://mark.mymonster.nl/2011/02/10/make-use-of-wcf-faultcontracts-in-silverlight-clients/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文