Chapter 11. Error Handling

It seems that every language has its own way of reporting error conditions. Take for example VBScript, which uses the error object (Err). To trap errors in VBScript, you use the On Error Resume Next function. Contrast that to the way that Windows, the operating system, reports error conditions. When you call one of the API functions, normally the function returns an error code as its output parameter. Depending on what function you call, the code may return 0 if the function was successful or a negative number if it was unsuccessful. However, other functions return 0 if the function was unsuccessful and a positive number if the function was successful. What Microsoft tried to do was unify the way that every language ...

Get C# Web Development with ASP.NET: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.