Use Exception.ToString() instead of Exception.Message.
Exception.Message
contains only the message (doh) associated with the exception. Example:
Object reference not set to an instance of an object
The Exception.ToString()
method will give a much more verbose output, containing the exception type, the message (from before), a stack trace, and all of these things again for nested/inner exceptions. More precisely, the method returns the following:
ToString returns a representation of the current exception that is intended to be understood by humans. Where the exception contains culture-sensitive data, the string representation returned by ToString is required to take into account the current system culture. Although there are no exact requirements for the format of the returned string, it should attempt to reflect the value of the object as perceived by the user.
The default implementation of ToString obtains the name of the class that threw the current exception, the message, the result of calling ToString on the inner exception, and the result of calling Environment.StackTrace. If any of these members is a null reference (Nothing in Visual Basic), its value is not included in the returned string.
If there is no error message or if it is an empty string (""), then no error message is returned. The name of the inner exception and the stack trace are returned only if they are not a null reference (Nothing in Visual Basic).
Use Exception.ToString() instead of Exception.Message.的更多相关文章
- exception 'yii\base\ErrorException' with message 'Class 'MongoClient' not found'
问题描述: 本来项目运行的好好的,搬了一次办公室(电脑主机一起搬的),第二天的时候就登录不了了. php版本和扩展没有改变,且没有修改任何配置,我尝试重启php5-fpm 服务,又重启nginx服务, ...
- springcloud 集成kafka问题记录,发消息报错:ERROR o.s.kafka.support.LoggingProducerListener - Exception thrown when sending a message with key='null' and payload='{-1,
在springcloud集成kafka,发送消息时报错: 2018-08-15 16:01:34.159 [http-nio-8081-exec-1] INFO org.apache.kafka.c ...
- 扩展Exception,增加判断Exception是否为SQL引用约束异常方法!
在设计数据表时,如果将某些列设置为关联其它表的外键,那么如果对其进行增加.修改操作时,其关联表若没有相匹配的记录则报错,或者在对其关联表进行删除时,也会报错,这就是外键约束的作用,当然除了外键还有许多 ...
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open con
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session f ...
- org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception
RabbitMQ 报出的错! org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException ...
- HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.h ...
- code is 9998;desc is 插入失败exception is org.hibernate.exception.JDBCConnectionException: Could not op
1.错误描述 [ERROR:]2015-05-05 09:27:12,090 [插入失败] org.hibernate.exception.JDBCConnectionException: Could ...
- 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n ...
- 【hibernate】报错:org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement
报错如下: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a ...
随机推荐
- 平衡树学习笔记(3)-------Splay
Splay 上一篇:平衡树学习笔记(2)-------Treap Splay是一个实用而且灵活性很强的平衡树 效率上也比较客观,但是一定要一次性写对 debug可能不是那么容易 Splay作为平衡树, ...
- P1987 摇钱树
题意:有n棵摇钱树,k天,每天可砍一棵并获得其金币 每棵树初始有$a_i$个金币,每天减少$b_i$个 问k天得到的最多金币数 这题很明显是DP(锻炼自己的机会来了QAQ) 设$f[i][j]$ ...
- 关于如何使用代码触发 UIButton的Unwind Segue
当我们在一个控制视图上,在UITextField输入文字信息之后,希望可以使用键盘的Done触发一个 Done的UIButton,但是刚开始我直接在 -(BOOL)textFieldShouldRet ...
- CF1101A Minimum Integer 模拟
题意翻译 题意简述 给出qqq组询问,每组询问给出l,r,dl,r,dl,r,d,求一个最小的正整数xxx满足d∣x d | x\ d∣x 且x̸∈[l,r] x \not\in [l,r]x̸∈[l ...
- SQL语句 ANSI_NULLS 值(ON|OFF)的含义
官方说明: 1.当 SET ANSI_NULLS 为 ON 时,即使 column_name 中包含空值,使用 WHERE column_name = NULL 的 SELECT 语句仍返回零行. 即 ...
- hdu3483 A Very Simple Problem 非线性递推方程2 矩阵快速幂
题目传送门 题目描述:给出n,x,mod.求s[n]. s[n]=s[n-1]+(x^n)*(n^x)%mod; 思路:这道题是hdu5950的进阶版.大家可以看这篇博客hdu5950题解. 由于n很 ...
- Go语言基础练习题系列1
1.练习1 题目:使用fmt分别打印字符串.二进制.十进制.十六进制.浮点数. package main import ( "fmt" ) func main() { var a ...
- ZoomEye(钟馗之眼)搜索技巧记录:
做个记录方便查看 钟馗之眼: 指定搜索的组件: app:组件名称 ver:组件版本 例:搜索 apache组件版本2.4:app:apache var:2.4指定搜素的端口: ...
- vue常见依赖安装
1):$ npm install less less-loader --save 2)style里 <style lang='less'> 2): $ npm i vue-resource ...
- NIOGoodDemo
Java NIO是在jdk1.4开始使用的,它既可以说成“新I/O”,也可以说成非阻塞式I/O.下面是java NIO的工作原理: 1. 由一个专门的线程来处理所有的 IO 事件,并负责分发. 2. ...