What is a First Chance Exception?

2023-12-13 20:58
文章标签 first exception chance

本文主要是介绍What is a First Chance Exception?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

David Kline

 

source:http://blogs.msdn.com/davidklinems/archive/2005/07/12/438061.aspx

What is a First Chance Exception?

Have you ever been debugging an application and seen a message, in the output window, about a "First chance" exception?

Ever wondered:

  • What is a first chance exception?
  • Does a first chance exception mean there is a problem in my code?

What is a first chance exception?
When an application is being debugged, the debugger gets notified whenever an exception is encountered  At this point, the application is suspended and the debugger decides how to handle the exception. The first pass through this mechanism is called a "first chance" exception. Depending on the debugger's configuration, it will either resume the application and pass the exception on or it will leave the application suspended and enter debug mode. If the application handles the exception, it continues to run normally.

In Visual Studio, you may see a message in the output window that looks like this:

A first chance exception of type 'System.ApplicationException' occurred in myapp.exe

In Visual Studio 2005 Beta2, you will see this message anytime a first chance exception is encountered in your application's code.  If you are using Visual Studio .NET 2003, this message is shown if you have configured the debugger to stop when the specific exception type is thrown.

If the application does not handle the exception, the debugger is re-notified. This is known as a "second chance" exception. The debugger again suspends the application and determines how to handle this exception. Typically, debuggers are configured to stop on second chance (unhandled) exceptions and debug mode is entered, allowing you to debug.

Does a first chance exception mean there is a problem in my code?
First chance exception messages most often do not mean there is a problem in the code. For applications / components which handle exceptions gracefully, first chance exception messages let the developer know that an exceptional situation was encountered and was handled.

For code without exception handling, the debugger will receive a second chance exception notification and will stop with a unhandled exception.

Take care!
-- DK

Disclaimer(s):
This posting is provided "AS IS" with no warranties, and confers no rights.
Some of the information contained within this post may be in relation to beta software. Any and all details are subject to change.

Published Tuesday, July 12, 2005 11:16 AM by DavidKlineMS Filed under: Debugging

这篇关于What is a First Chance Exception?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/489929

相关文章

myEclipse失去焦点时报错Unhandled event loop exception的解决方案

一句话:百度杀毒惹的祸。。。。果断卸载后问题解决。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFArra

这个错误说的是一个不可变数组负值给了一个可变的数组。有可能你前面定义的数组是一个可变数组,但是在你其他方法里面用他的时候,他就是一个不可变数组,因为在可变数组拿到别的地方用的时候,他会默认为不可变的,可能这只是一个类里面你只是简单的声明了他吧,并没有进行对他初始化,或者分配什么内存,所以他只是一个不可变的数组,当你在其他地方用他的时候,他就默认为不可变的数组,他可能因为你的没分配内存,而变回不可变

广度优先搜索Breadth-First-Search

目录  1.问题 2.算法 3.代码 4.参考文献  1.问题         广度优先搜索,稍微学过算法的人都知道,网上也一大堆资料,这里就不做过多介绍了。直接看问题,还是从下图招到一条从城市Arad到Bucharest的路径。  该图是连通图,所以必然存在一条路径,只是如何找到最短路径。 2.算法 还是贴一个算法的伪代码吧: 1 procedu

Exception in plugin Android ButterKnife zelezny

所在页面的布局文件命名id有问题,不能有两个下划线,,如tv__name

深入拆解 Java 虚拟机 】Exception异常笔记

【深入拆解 Java 虚拟机 】Exception异常笔记 try-with-resource语法糖finally try-with-resource语法糖 try后对象的close方法都会被运行。 package com.exception.demo;public class Foo implements AutoCloseable {private final Strin

Exception in thread main java.lang.NoClassDefFoundError: org/apache/juli/l

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/l MyEclipse整合免安装版的Tomcat7,------> 看图吧 最后这个就可以在myeclipse里,使用你的tomcat,而不是用.bat打开!!!!

LeetCode - 41. First Missing Positive

41. First Missing Positive  Problem's Link  ---------------------------------------------------------------------------- Mean:  给你一组整数,找出第一个空缺的正整数. 要求:时间O(n),空间O(n). analyse: 这题时间O(n)想了

Java中Exception知识点

Exception 不论代码块是否处于try或者catch块中,只要执行该代码块时出现异常,系统都会自动生成一个异常对象try块里声明的变量是局部变量try和catch块后的花括号不可省略捕获多种异常时,多种异常类型之间用竖线|隔开捕获多种异常时,异常变量有隐式的final修饰,因此不能对异常变量进行赋值如果在异常处理代码中使用System.exit(1)退出虚拟机,则finally块不会执行除

如何使用 ef core 的 code first(fluent api)模式实现自定义类型转换器?

如何使用 ef core 的 code first 模式实现自定义类型转换器 前言 1. 项目结构2. 实现步骤2.1 定义转换器2.1.1 DateTime 转换器2.1.2 JsonDocument 转换器 2.2 创建实体类并配置数据结构类型2.3 定义 Utility 工具类2.4 配置 DbContext2.4.1 使用 EF Core 配置 DbContext 的两种实现方式2.

chapter12-异常(Exception)——(作业)——day15

目录 457-异常课后作业 458-异常课后作业2 457-异常课后作业 package chapter12.exception.homework;/*** @author LuHan* @version 1.0*/public class Homework01 {public static void main(String[] args) {try {if(args.l