The various techniques used for maintaining stable program state in circumstances that, if not taken care of ("handled"), could cause serious issues, including logical bugs and abrupt execution termination.

learn more… | top users | synonyms (1)

7
votes
3answers
50 views

Checking for intersection points

The aim of the program is to find those points which comes under the intersection of at least 2 circles.(space is a 1000x1000 matrix) ...
7
votes
1answer
48 views

Controller action to process orders and payments

I'm trying to reduce the if statements and simplify this create action. ...
3
votes
2answers
74 views

Multi threaded TCP server

I wrote this just for fun, to hone my exception handling skills. I want to know what I can do better in terms of exception handling (and otherwise) in the below code Server ...
1
vote
0answers
29 views

Multicast Mining Rig Scanner [closed]

The class MulticastMinerScanner is a Runnable that scans for miners (computers running a mining client called CGMiner, which is configured to listen/respond for a multicast message containing the ...
1
vote
0answers
38 views
5
votes
3answers
410 views

Try/catch in a Tic-Tac-Toe game

I'm looking at my code and it doesn't look very efficient. I'm simply trying to catch exceptions or prevent them from being thrown in the first place. Can you please take a look and tell me if there ...
4
votes
1answer
49 views

Querying MongoDB for information on a collection of books

I have this huge chunk of code. Is there any better to write this code, or am I too paranoid that I check every MongoDB query for error? The logic is here: Bookcollection = collection of books Book ...
0
votes
1answer
53 views
1
vote
2answers
78 views

Stop connecting to a server after n unsuccessful attempts

I am trying to connect to a server. If the connection goes through, then print an apt message. If the connection does not go through, try for a total of n times. And quit after the nth attempt ...
5
votes
4answers
315 views

Java Stream Exception Handling

I find this piece of Java code really ugly and cumbersome. How can I refactor it to be more clean and easier to read? ...
2
votes
2answers
156 views

Returning latest database ID

I want my method to use a finally block so I can be ure that my EF entity is disposed after usage, even if an exception is thrown, but I would also like to not ...
2
votes
1answer
72 views

Is this the right way to handle Exceptions in PHP?

I'm using the function countLikes() to fetch URLs' Likes count from the Facebook API. ...
7
votes
3answers
103 views

RateBeer.com scraper

This was largely an exercise in making my code more Pythonic, especially in catching errors and doing things the right way. I opted to make the PageNotFound ...
4
votes
1answer
91 views

AsyncTask which allows to handle exceptions on UI

The AsyncTask available in android, gives you the result from doInBackground on the UI thread so that you can update UI ...
0
votes
2answers
105 views

Elegant way to handle errors with JSP and Servlets (Model 2)

I have a form that submits to a registration Servlet, which inserts a new user to the database when they sign up to the web application. Depending on the erroneous user input, the Servlet will ...
3
votes
2answers
462 views

Class design for a student class

Problem Statement: Design a STUDENT class to store roll, name, course, admission date and marks in 5 subjects taken from user. Create an array of STUDENT objects. Provide methods ...
2
votes
1answer
32 views

Improving efficiency and flow by changing subroutine orders

A batch file executes WinSCP.exe's console mode to download files and log the actions. Upon exit, WinSCP returns: ERRORLEVEL 0 if the files are successfully ...
1
vote
3answers
68 views

Type determined return values

I have the following js code: ...
1
vote
1answer
57 views

When should I call set_exception_handler with this exception handler class?

This is a simplified version of ExceptionHandler.php: ...
3
votes
1answer
91 views

Error-handling #ifdefs for AFNetworking requests

I am using AFNetworking 1.4.3 to send and receive network messages in iOS. My application works slightly differently in DEBUG and RELEASE mode, so I need to use ...
7
votes
2answers
100 views

Swift error handler for HomeKit

I have this universal error handler for my HomeKit app (currently in development). It grew out of wanting a single place to write error messages, show alerts, etc. I wanted a short, simple way to call ...
3
votes
1answer
125 views

File Exists Script Task for SQL Server SSIS

I have an SSIS package for SQL Server 2008. In this package, I need to verify that a file exists that matches a pattern of SomeFileName_*.txt where the wild card ...
3
votes
1answer
63 views

Handling errors on a web application

I have this C# production code for handling errors on a web application. There are currently two applications that use the class. In each application I initialize the class within the ...
2
votes
1answer
131 views
4
votes
1answer
95 views

Error Handling in Servlets and JSPs

I have an HTML login form that is processed by a servlet, which then redirects the user to a result page. login.jsp: ...
15
votes
6answers
1k views

Is wrapping exceptions good practice?

I have recently been refactoring some code in an effort to improve the exception handling, particularly to aid in improving the level of information given to developers during development. However I ...
2
votes
1answer
297 views

Mongoose promise & error handling

I search for rails-like way of writing NodeJS code and it's more then hard to find the right way. The code quickly become bloated and unreadable. I would like my code to be as clean as possible. ...
3
votes
2answers
544 views

Exception handling best practices

I'm actually working on a piece of code which use the following code: ...
3
votes
2answers
48 views

Haskell monad- and error-handling-style

As an answer to excersise 2.3 in Chris Okasaki's book, Purely Functional Data Structures, Inserting an existing element into a binary search tree copies the entire search path even though the ...
0
votes
1answer
101 views

Nested try/catch with PDO in PHP

I would like to know if this is the correct way to use try/catch when dealing with multiple MySQL queries and PDO: ...
9
votes
3answers
1k views

Coding style of critical server's code

I was writing a server that should serve more or less a thousand clients. After writing the net part of the server code I had to stop writing because I saw that the code was chaotic and not very ...
0
votes
1answer
24 views

Showing a JDialog whenever there is an exception

I have made a method which I use to show the exception error through a JDialog window whenever there is one in my program. For now I can pass it either a String or ...
11
votes
4answers
805 views

Writing null-safe code to set form values

I will ask my question using the following example: HTML ...
1
vote
1answer
42 views

Error-handling in Django model-adding form

I am writing a book database, and ultimately a library system, in Django. When a book is created without a title set, the ISBN will be used to automatically fetch book data from WorldCat I have just ...
4
votes
2answers
329 views

Simple factorial program using recursion

Two concepts I realized I needed to understand and use more are recursion and Exceptions. Thus, I combined both in the following program. Although it began with a focus on using recursion it became ...
11
votes
3answers
675 views

Returning status codes from business layer

This is what I've been doing so far in my business layer to return error messages to the user. ...
3
votes
1answer
100 views

Creation of a temp file on Windows

I implemented a test that reads data from temp file on Windows. I originally had an issue that I solved with the help of this answer ...
3
votes
2answers
49 views
4
votes
3answers
197 views

Error-handling / Self-Validating mechanism

The below idea seemed to look clean, to allow the object itself to validate its values for different scenarios. For eg: While creating the object, the value of Object1 and Object2 in ...
6
votes
2answers
327 views

Generic error message factory

The purpose of this code is to centralize all error / status messages to present to the user. For example, registering an account and the user email address is already registered. A status code is set ...
1
vote
0answers
75 views

Mini eCommerce Application and Message/Warning/Error Handling

I decided to build a basic eCommerce application in c++ as a learning experience. In the past, I've gone with a fat controller, skinny model approach, and while it has worked, my results always end up ...
3
votes
1answer
64 views

Idiomatic catching of unchecked exceptions in ExecutorService.submit

OK, here's the problem space: Lwjgl, a graphical library, has the ability to throw an unchecked LWJGLException on certain methods - like ...
2
votes
0answers
84 views

Rails app that scrapes forum using Nokogiri gem

I've built a website that scrapes a guitar forum's pages and populates Rails model. I'm using rake task along with heroku scheduler to run background scrapes every hour. On the homepage, the forum ads ...
10
votes
4answers
1k views

Send email just once per day

I want to send an email just once per day. There is one button and any user can click that button. The email must not be sent twice. When the first user clicks the button, the email is sent. If ...
3
votes
2answers
211 views
5
votes
1answer
97 views

Pausing a SwingWorker with a Timer

I made a SwingWorker which is fetching tweets using the twitter4j API. The twitter API will allow 180 queries every 15 minutes, and then throw an exception with ...
3
votes
1answer
882 views

Error Handling - Controller's OnException and Application_Error

I'm pretty new to MVC. Below is the code that I have added to an existing MVC 5 application. The code is using log4net to log any run-time error/exception. NOTE: I could override ...
7
votes
2answers
100 views

Exception handling for HTTP request timer

This method is used to check a URL and return the time it takes to check and the HTTP status code: ...
3
votes
1answer
83 views

Throwing an exception within a try/catch block in PHP

Is there a cleaner way to do this? ...
7
votes
3answers
140 views

Creating check parameter class instead of repetitive null checks

What I'm trying to accomplish is to have a error checking class mostly to check if parameters that are pass null but also data structures within class are not null. So my thought is a clean static ...