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)

2
votes
0answers
7 views

Test web application

I am writing a test web application in Golang. Create post handler: ...
1
vote
0answers
27 views

Dynamically created Exception classes

This is a question about best practices. I have a project I am building and I have the following base Exception class: ...
0
votes
1answer
29 views

Class and Static practice, IDS and a max instance count [closed]

I was practicing working with classes and the static property included with them and came up with a simple ID counter and max number list. I also added a quick debug error ...
9
votes
2answers
212 views

Memoizing decorator that can retry

I have some tasks that I'd like to memoize because they connect to a rather slow network and have to wait for the data. Unfortunately this network can be a little finnicky and we get occasional ...
3
votes
1answer
33 views

Catch all checked exceptions and turn into unchecked exception

I am currently trying to learn Lambdas and following the book Java SE8 for the really Impatient and just finished Chapter 1 of it. This is the question, I am trying to get done with: Didn’t you ...
4
votes
2answers
53 views

Handling request errors in snap with haskell

I'm currently taking a look at Snap with Haskell. I'm pretty new to Haskell and functional programming in general and am working out the best way to handle errors. Currently I have something like this ...
11
votes
2answers
242 views

Returning result and error status for number type conversions

Looking for review of design strategy of using a struct to return the functional result and error status. Your experience of how my design approach may succeeded ...
-3
votes
2answers
54 views

Raise, handle and note down the custom exceptions [closed]

I am creating a custom Exception class and trying to log the CallerFilePath, ...
13
votes
6answers
509 views

Storytelling program: Gathers stories from certain popular story websites/formats and reads them aloud

Audiobooks make my life easier when I have idle ears and a mind free to wander, but something better for my eyes to do. This program is one of my more recent efforts to allow most of the stories ...
4
votes
1answer
38 views

Handling an invalid SQL query exception

This is my DAO object that takes the Cypher query as a string, and returns a JSON representation of the graph it returns. Because it's using a Spring JdbcTemplate ...
13
votes
7answers
1k views

Imposing a sort order on a query

I've always been told "never use goto, there's always a better way" and for the longest time I just accepted it. Lately though, I've been running into such scenarios in which I have to repeat this bit ...
1
vote
4answers
56 views

Python Decorator - inspecting function argument values

Some of my functions use a "fail_silently" flag. It is used in the following way: ...
2
votes
1answer
120 views

Checking for Internet connectivity on Android

I wrote this code to check an internet connection and was wondering if this is the best way to do this check. ...
4
votes
2answers
82 views

Get an integer as input and display Pi rounded to that amount of decimal places

I've been writing a program that accepts an integer as input and displays the number Pi rounded to that number. The only issue I see is the fact that the Math.Round ...
2
votes
1answer
58 views

Program simulating dictionary using file handling - part 2

This is the new version of the dictionary program which I uploaded for reviewing here. I would be grateful if the program could be reviewed for all the points mentioned in the above link. ...
5
votes
3answers
247 views

Try catch statement in VBA using the standard VBA error handling statements

The code below is pretty self explanatory: just copy and paste it all into a module and run it, it provides a few use cases and many explanatory comments in the text. (It works but I'm interested to ...
1
vote
2answers
71 views

Logging mechanism

I have the following code: ...
2
votes
1answer
47 views

Backing up two tables using SQL transactions

I'm using a transaction statement in SQL Server 2012 for the first time. I want to insert Table1's data in Table1_Backup before ...
7
votes
1answer
88 views

Proper checked exception handling with lambda functions

I'm having trouble finding a clean way to handle checked exceptions thrown by a lambda function passed as a parameter in Java. I'm writing a Client which will interact via RMI with a Server to play a ...
0
votes
1answer
34 views

Retry storing HTTP response into a variable until specific code

I want to keep trying to get response until its code is 200 or unknown yet. In first case it should be stored in response variable. In another case I should raise ...
10
votes
1answer
91 views

Try-except decorator for classmethods

This question is related to the Cactus Text Game Engine. For easy error handling in Cactus, we've put together this small decorator. Essentially, the decorator wraps any class method in a ...
4
votes
1answer
33 views

Monitoring and re-establishing a PostgreSQL connection

Within a complicated Ruby project, I need to monitor the connection to a PostgreSQL database, as answered here. I use a thread for this purpose. Every few milliseconds, I invoke "consume_input" which ...
-1
votes
2answers
80 views

Creating music using the JMusic API

I'm trying to write a program that creates music, and I am using the JMusic API to accomplish this. These are the following constants defined in JMusic that I'm using: ...
2
votes
1answer
27 views

Generating URL and status for an S3 bucket

The following program generates the S3 URL and response (status code?) for the key, provided the bucket name and if the S3 URL is a mess (wrong url), then it generates empty string as URL and error as ...
1
vote
1answer
51 views

Exception handling for a chain of prompts

I am trying to make an inputin() function to take all the parameters input for the first time with exception and for individual parameter for the runtime ...
8
votes
4answers
364 views

C# PasswordService class

I am new to C# and develop a configurable PasswordService class. As the code works the next step is to improve the code. Right now there are the following options: ...
5
votes
5answers
173 views

Map error messages to conditions

I have a method which checks some preconditions and if everything is fine returns a success response object, otherwise fail with ...
8
votes
1answer
81 views

RPN calculator with interactive and non-interactive modes

While writing this review, I edited the code until it became something quite different from the original. In addition to the issues I mentioned, I ended up adding features: More operators / ...
1
vote
1answer
71 views

Custom error handler for PHP

I've written a custom Error handler for use in PHP. What it does is simply capture PHP errors, and logs them using Monolog. It works, but I can't help that it has too much stuff inside. I could ...
10
votes
2answers
422 views

Handling try catch in VB6

I asked a question elsewhere on Stack Exchange and was given an answer by multiple people that checking for errors in-line was not a good practice. I have been using an ...
3
votes
1answer
69 views

Error handling for Stripe credit card processing

I have a rails application that uses Stripe for credit card processing. Currently several exceptions are being handled anywhere a transaction takes place. The code below is being used currently in 11 ...
15
votes
5answers
685 views

Populating a ListView with Items

I populate a ListView with Items. Each Item has data attached to its .Tag property. Over time, I have needed to handle many cases where something would be null or ...
5
votes
2answers
145 views

IO and Scanner exception handling

I have created a sample file reading program as an exercise while learning how to implement good exception handling. I want to ask: is this a good approach or is there some other solution that I am ...
1
vote
1answer
45 views

Logging out using nested promises

Is it OK to do that ? for example, I have my log out service ...
2
votes
0answers
43 views

Restful API for parsing records

I'm trying to implement my own API. This code excerpt should show the basic working routines. The storage is temporary an in-memory-array and the only HTTP method for now is POST. I outsourced the ...
2
votes
2answers
79 views

Accessing value from either os.environ or argparse

I have the following code: ...
12
votes
1answer
150 views

Wanted a cat. Got lolcat

Wanna learn Rust? Ya rly! I can haz FizzBuzz? No wai! Gimme /bin/cat then. But rustc say LOL! Must handle teh err0rz! Now iz ...
4
votes
1answer
60 views

Continuable if error is null

I made a method that I can use to avoid having to handle errors from callbacks. What it does is, call the passed method only if the first argument is null. So essentially it will bypass to the last ...
0
votes
1answer
40 views

Asking for a number in Java Swing

Is it good way of asking for a number? Should that function return 0 if there is an error? ...
2
votes
1answer
99 views

Playframework (Scala) custom exception handling

I am using play framework with scala and here is a scenario on which I would like to have your opinion. Let's say I have 2 ...
3
votes
1answer
72 views

Functionality for automatic retry after exception

I have made the following system to automatically retry network calls if some exception is thrown. (Earlier posted on stackOverFlow, solution inspired by what @Boris answered) ...
1
vote
2answers
281 views

Replacing thrown exception with more descriptive exception during file I/O

My code needs to open a specific file. Under certain (expected, but rare) conditions, the code will get handed a file path to a file that does not exist -- the path is expected to be otherwise valid ...
2
votes
1answer
79 views

Throwing exceptions in a database wrapper

I hope the extension methods ThrowArgumentNullExceptionIfNullOrEmpty and ThrowNullReferenceExceptionIfNullOrEmpty are ...
6
votes
1answer
179 views

LiveDate version 2

LiveDate has the ability to display the current date either by asynchronously fetching the time from a server or by just using the client system date. It's only as ...
4
votes
1answer
91 views

String find and replace method optimization

I am trying to find a specific header string from different Maps (LEDES1998Bheaders, LEDES98BIheaders and ...
6
votes
1answer
253 views

Calling other machines from the LinkedList if one is blocked or down

This is a follow on to : Simplifying asynchronous "executeAsync" method along with "onFailure" callback. I am using AsyncRestTemplate as my ...
2
votes
2answers
115 views

Users and friends query with retry, returning JSON

I am new to Azure and SQL. I have the following function that is part of a larger Web-API which is hosted on Azure and is querying an SQL Server database that is also hosted on the Azure platform: ...
1
vote
0answers
23 views

Sourcemap translator service

This is my first attempt to a serious Node.js application, I've tried to follow the async style of Node at my best, but I have several doubts and I am sure that this code can be massively improved. ...
1
vote
1answer
106 views

Validate IP address and create a registration attempt

I'm a C++/Python developer attempting to learn JavaScript, but I'm struggling to write clean code. I've read that async.waterfall and Promises are two ways to flatten the code a bit, but my ...
7
votes
3answers
323 views

Simplifying asynchronous “executeAsync” method along with “onFailure” callback

I have a system in which user id is "sharded" across all the machines which means each machine is responsible for certain user id data. I am working on a library which will take ...