Questions tagged [error-handling]

Programming language constructs designed to handle errors signaled by error codes, exceptions or other language specific means.

Error Handling comprises design of the code that handles errors, as opposed to the code that handles the (normal) program logic in the absence of errors during program execution.

See also

22833 questions
7
votes
3 answers

Error Handling in Model (MVC)

I was wondering what the excepted standard is for handling errors in the Model. Currently I have 'setError' and 'getError' methods that's in use by all my Models. This means I'm only concerned with whether a call to a method in my Model is true or…
Andre
  • 1,187
  • 3
  • 13
  • 22
7
votes
1 answer

What HTTP status codes fire error event on XMLHttpRequest

I've read every spec I can find, even the W3 for ProgressEvents as well as XMLHttpRequest, and I'm finding diddly regarding WHICH status codes (or What response) fire an Error event on an async XHR request. The most I can find is references to…
7
votes
4 answers

Is there a reason why perror isn't widely seen in code for error handling?

Looking at code at stackoverflow or elsewhere, it seems I rarely see perror() being used to report the exact nature of an error. printf is much more common. Is this an indicator that there's something wrong or missing with perror? I'd expect it to…
Gustavo Litovsky
  • 2,357
  • 1
  • 24
  • 40
7
votes
1 answer

What does E_STRICT do?

I'm actually interested in making sure our codebase is free of errors that would be warned against by PHP's builtin error checking, but I'd like to see exactly what E_STRICT enforces. By extension, what are PHP's "strict standards"? I looked but…
Anthony Bishopric
  • 1,286
  • 10
  • 22
7
votes
1 answer

Centralizing error handling in an express.js-based app

I just recently started working on an express.js based application, which also uses the pg module (https://github.com/brianc/node-postgres) I also spent a significant amount of time, reading about node and express approach error handling, the…
user1219569
  • 115
  • 5
7
votes
4 answers

C++ Error Handling - downside of using std::pair or std::tuple for returning error codes and function returns

Without getting into the general exceptions vs error codes discussion, what do you think are the downsides of using std::pair or std:tuple for returning multiple values, namely the function's return value AND the error/success code, similar to how…
CodeSalad
  • 1,335
  • 2
  • 14
  • 20
7
votes
4 answers

Global error handling (outside of controller) in ASP.NET MVC

Let's say I put the following code somewhere in a Master page in my ASP.NET MVC site: throw new ApplicationException("TEST"); Even with a [HandleError] attribute placed on my controller, this exception still bubbles up. How can I deal with errors…
user10789
  • 334
  • 3
  • 13
7
votes
1 answer

Tracking down database connection issues

Background We have a number of web applications on different web servers that connect to a single database server. Over the past couple months, we have noticed that every once in awhile, our web servers won't be able to connect to the database…
7
votes
3 answers

When I catch an exception, how do I get the type, file, and line number of the previous frame?

From this question, I'm now doing error handling one level down. That is, I call a function which calls another larger function, and I want where it failed in that larger function, not in the smaller function. Specific example. Code is: import sys,…
Claudiu
  • 206,738
  • 150
  • 445
  • 651
7
votes
5 answers

Sending data to a website from a WCF service

I have the following setup A jQuery website (not exactly single page, but not far from it), that uses a A ASP.NET MVC website as a backend, which connects (via net.tcp or net.pipe) to A self-hosted WCF service that manages and connects to A…
SWeko
  • 28,824
  • 9
  • 68
  • 102
7
votes
3 answers

User Input of Integers - Error Handling

I'm having some trouble with certain input areas of my program. There are a few parts where the user inputs a specific integer. Even if they enter the wrong one that's all fine and dandy, but I noticed if they enter anything not of integer type like…
trikker
  • 2,473
  • 9
  • 37
  • 52
7
votes
2 answers

Break in Class Module vs. Break on Unhandled Errors (VB6 Error Trapping, Options Setting in IDE)

Basically, I'm trying to understand the difference between the "Break in Class Module" and "Break on Unhandled Errors" that appear in the Visual Basic 6.0 IDE under the following path: Tools --> Options --> General --> Error Trapping The three…
7
votes
6 answers

Login failure: unknown user name or bad password

We are running Visual Studio 2012 and Team Foundation Server 2012. In the Team Explorer window, I am able to successfully connect to our TFS environment. However, when I select the Security link under Team Project or Team Project Collection, I…
Steve
  • 885
  • 1
  • 10
  • 22
7
votes
3 answers

Unhandled exception not caught by either Global.asax error handler or custom IHttpModule error handler

I have one method of a class (DPCal_EventMove) that I want to limit access to using Roles. I have both a Global.asax.cs error handler and a custom IHttpModule error handler intended to catch unhandled exceptions and Server.Transfer them to…
Matt
  • 2,188
  • 1
  • 20
  • 34
7
votes
1 answer

Accessing error messages for nested attribute field

I have a form created using the simple_form gem which populates 2 models using nested attributes. I want to check if there are any errors and display a new block. However, I'm not sure how to correctly access the error message for the location…
1 2 3
99
100