zoukankan      html  css  js  c++  java
  • Differents between error and exception in C#

    An error is a mistake is coding on the part of the programmer, so the program won't give the desired result.

    For exampile, in ASP.NET there are different types of error:

    1. Configuration error: these error arise when the web.config or machine.config files are not formed properly.

    2. Compilation error: raised during compilation due to mistakes in language syntax

    3. Parser errors: caused by incorrect tays and other syntax error in the ASP.NET page.

    An exception is a run-time error that may occur due to wrong input type or other circumstance. for example:

    divide by zero, worng format, file not found, file used in another application, array out bonds, over flow, DBNULL cannot convert to int string etc.

    Errors are not handled they have to fixed by the programmer.

    Exceptions should be handled using exception handling code(try catch throw block) so that the application won't crash. and inform user that exception has occured. can show the description of the exception, the exception arised in which function and which line etc.

  • 相关阅读:
    假期进度报告2
    假期进度报告1
    JavaScript下判断元素是否存在
    浪潮之巅阅读笔记06
    浪潮之巅阅读笔记05
    浪潮之巅阅读笔记04
    【C语言】C语言简介
    iOS网络监测方法
    iOS常用手势识别器
    【CoreData】 简单地使用
  • 原文地址:https://www.cnblogs.com/Jenny90/p/2968872.html
Copyright © 2011-2022 走看看