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)

3
votes
2answers
53 views

BMP file writer

In my current project I'm writing a C function to write a BMP-File. Internally, the function is split up into three parts: write header, write info header, write data. In some of these functions I do ...
3
votes
1answer
19 views

Linq-to-Sage: CRUD Operations

Following-up on my Linq-to-Sage implementation, I ended up implementing all CRUD operations, following the Sage 300 view protocols. So, the entities derive from classes that look like this: ...
0
votes
0answers
37 views

Ingest data from an RDBMS to Hadoop Hive database using Sqoop

Context: The below code will run a series of steps in an ETL workflow. I would like the code to be reviewed to avoid memory bottlenecks and null pointer exceptions etc. UseCase: Ingest the data from ...
2
votes
2answers
65 views
1
vote
0answers
35 views

PHP class's errors in different languages

I have a data validation class, which I would like to return errors in many languages. I'm not writing the whole class, just the needed parts as my question only refers to that. ...
1
vote
1answer
58 views

Fetching and parsing HTML from a URL [closed]

I get a page with urllib2, then parse it with lxml. There are generally two things that can go wrong: a ...
1
vote
1answer
36 views

Recording a customer's shopping cart as an order 2.0

Some days ago, I put up a question here for review about the best way to handle JDBC transactions in the context of an e-commerce Java web application. After a kind suggestion from user @gardenhead, ...
2
votes
2answers
154 views

Many nested session verification conditions

Can someone give me advice on cleaning this code? It's more messy then I expected. I got like 10-15 more ifs to be added. I've thought of adding the error messsages in methods and then just check if ...
2
votes
0answers
83 views

Improved NullGuard v4 that supports property chains, methods and ignores value types

While working on my simple NullGuard recently I quickly came to the conclusion that this is not enough so I build a more advanced null checking. Once again I ...
3
votes
1answer
39 views

Loading a database table using a promise chain

I am creating a util module that I'm using to communicate with a MS-SQL database. I want each public method to return a promise. I started with a private function that executes a DB query and returns ...
2
votes
2answers
98 views

Recording a customer's shopping cart as an order

I have come up with the following method to post a transaction to a database, in the context of an e-commerce Java web application. The transaction consists in submitting a new order alongside its ...
5
votes
0answers
49 views

Error Handling for XML parser

I have the following Ruby code, which parses an XML document sax style (it's a very simplified version): ...
3
votes
1answer
50 views

Function outcome: consistent approach and easy logging

My goal is to make a consistent and easy way to determine how a function fails/succeeds. I'm looking for code review of my Status class for any bad practices, code ...
7
votes
2answers
49 views

Querying Facebook for details of a user's OAuth token

This class exposes the public method getAuthToken which takes a user's Facebook OAuth token as an input parameter and queries Facebook for information about it - ...
0
votes
0answers
48 views

Exception-logging handler for the DAO layer

I'm a bit clueless on how to handle exceptions. What I've think so far is to use a custom error page for the users so they can't see the full exception for security reasons and log the exception in a ...
11
votes
4answers
162 views

Get Workbook Method(s)

I'm re-writing my Module of standard methods. These 3 are used to retrieve Workbooks as Workbook Objects. The standard I'm aiming for here is "Third-party Library/Add-in". So: Do these functions ...
5
votes
1answer
34 views
5
votes
2answers
37 views

Single class which holds response and error message

I am working on a library which will make HTTP call to my rest service basis on inputs passed to this library. And whatever response comes back from service whether it is successful response or ...
3
votes
2answers
48 views

ErrorManager management

Recently I created a class that would manager errors, log them, and write details about them to files when the function logError was called. It would be done by ...
1
vote
3answers
106 views

Retrying a web request in Python

Is it fine to retry a web service call like this in Python? Would there be any scenarios the exception might not work the way we expect it? I expect it to continue only if it's fine, otherwise just ...
3
votes
0answers
36 views

Stylishly saving source

Simple tool to save a web page's source. Styled to resemble Sublime Text, given frequent personal use. I took the opportunity to learn and apply an MVC approach, the FXML is generated via Scene ...
5
votes
2answers
151 views

Design watchdog, reconnecting to server

I have console application that sends and process XML data. I have created a fault mechanism that the connection drops. I go in a "fault" mode. And try to reconnect to my server. I'm sending ...
3
votes
2answers
425 views

Read sales transactions from Excel

This is a program to read and store the data from a Excel file (.xlsx) which is uploaded by users. Any better approach to reduce the usage of if-else to return the error message? How to design or ...
0
votes
1answer
73 views

Two similar functions for writing data to binary file using BinaryWriter

I have two functions for writing data to binary file using BinaryWriter. The first function has single data object as argument and looks as below: ...
5
votes
1answer
37 views

Initializing an EGL display

I'm somewhat new to writing real-world projects in C, so I'm not familiar with best practices and standards. I'm writing code dealing with EGL and OpenGL, and some setup calls might fail for reasons ...
3
votes
2answers
47 views

AppVersion Struct & VersionParse Exception

I am working on an app that will interact with assembly (app) versions. I created a struct for that, along with an exception for parsing error. Here's the code: ...
2
votes
1answer
37 views

Handling success and failure when retrieving product information

I've got an Angular controller where I have two functions that are repeated inside two functions: ...
2
votes
2answers
57 views

Implementing bounds-checking with exceptions based on an existing bitset container

BitPat here is a wrapper around a bitset. ...
3
votes
2answers
103 views

Throw an exception which contains a nested set of previous exceptions

I have a set of domain objects which try to find a solution to a problem. The top level object has an algorithm which splits up the problem and delegates it to lower level objects, which in turn do ...
1
vote
1answer
53 views

Array search algorithms: performance comparison

I'm making a program that compares multi-key sequential search and Interpolation search in a sorted array by the number of array accesses for my assignment. ...
1
vote
0answers
24 views

Uploading LDAP search results to an FTP server

I know this is quite a generic question, I was hoping it could stay open so I can try to improve my styles. Basically, I have an application that connects to LDAP, performs searches, and produces a ...
0
votes
2answers
45 views

Concatenating multiple strings from a JSON response

I would like to concatenate a series of strings populated from an XHR response. So, I've chosen to do it like this: ...
3
votes
1answer
102 views

Retry Runnable java

I want to make class to retry doing what I want if specific exception happen for n times before throwing exception, so I write below class and used Builder to build it could you please review it and ...
3
votes
2answers
61 views

Delay to avoid cocurrent modification

I was attempting to remove items from an ArrayList while iterating through it, only to find out that Java doesn't like that. So I quickly wrote up a ...
4
votes
2answers
37 views

Raising an error if a variable is not created during class initalization

I would like to properly raise an error if self._header was not created when I initialize a NewFile object. This is working ...
2
votes
2answers
52 views

Controller method to validate and save

I have built RESTful web services. The services endpoints have a similar logic: If the input validation succeeds, do a database operation and return the result. If the db operation fails, return the ...
23
votes
6answers
3k views

Unbreakable average program

I'm creating a program that averages four numbers - three from a file and one from user input. Simple enough. But the catch is, the professor is going to be deliberately trying to break the program. ...
4
votes
1answer
326 views

Layered architecture implementation in a Java web application

I am trying to learn how to design and implement a layered Java web application with a presentation layer, service layer and the DAO layer. I have used the Struts 1.3 framework with Java JDK 1.6 for ...
3
votes
1answer
120 views

Custom error/fatal error and exception handler in PHP

Introduction I wrote three functions that aims to log errors and exceptions as well as show a user a generic error page. Would appreciate some feedback on it with regards to the PSR standards and if ...
4
votes
2answers
278 views

forever.sh - should keep a process alive forever

This script's only responsibility is to keep a process alive. Forever. It's sole dependencies shall be bash and coreutils. I'm ...
3
votes
0answers
133 views

“Extending” the Swift 2 ErrorType protocol

I am building a simple REST client in Swift 2. The methods the client offers can return errors. Every method returns the same errors (network problem, unauthorized, etc...). But each method can also ...
10
votes
2answers
89 views

Creating a pseudo Pivot Table / Database using a 4-D array

Why am I not just using a Pivot Table / Database? a) I've never ever used either before. And I don't have time to learn how before this project needs to actually be finished. b) The final output ...
6
votes
2answers
519 views

Servlet file uploader

I think this code looks ugly, especially with the multiple try-catch blocks, but I don't know how to rewrite it: ...
6
votes
1answer
82 views

Avoiding code repetition while handling exceptions

For my application, I need to use two slightly different algorithms for persisting an entity: ...
3
votes
2answers
76 views

Netscape bookmark file generator

I started to learn Rust some time ago and I wonder if there is some way to write Rust code that is both concise and safe — in particular, avoiding unwrap(), casting ...
4
votes
2answers
65 views

Property file loader

I have the following code: ...
4
votes
2answers
75 views

Printing gitignores

I have written a simple program in Java 7 to write the .gitignore of different file types: ...
2
votes
2answers
84 views

Root-finding by iterated bisection

Both of the following code give the same result. But I'm not sure where should I put the raise statement. ...
2
votes
2answers
1k views

Load text file into an array in Swift

I'm drowning in Swift optionals and error handling syntax. I'm just converting a text file into an array of Strings. One would think that this could be a simple two or three liner but by the time I ...
10
votes
1answer
153 views

C++ alternative to exceptions

I've been thinking about error handling in C++ lately. Exceptions are a great way of handling errors in most applications. However, I work in the games industry where it is commonly accepted that ...