捕获从javascript中的c#web服务引发的异常 [英] catching exceptions thrown from a c# web service in javascript

查看:191
本文介绍了捕获从javascript中的c#web服务引发的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在我的Web服务中抛出异常,并且我想给用户一个更有意义的错误信息,而不是一般的em,处理您的请求时发生错误,有什么可能的可以将异常消息传递给客户端的技术?

If an exception is thrown in my web service and I wanted to give the user a more meaningful error message rather than a generic 'an error has occurred when processing your request', what are some possible techniques that can be used to pass the exception message back to the client?

这是可接受的做法吗?

is this something that is acceptably practiced?

推荐答案

这可能是这个问题最有帮助的答案

this is probably the most helpful answer to this question

JSON服务在失败/错误时返回什么

所以,感谢Crescent Fresh

so, thanks to Crescent Fresh

这篇关于捕获从javascript中的c#web服务引发的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆