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.
-1
votes
0answers
15 views
Singly Linked List in Stack [on hold]
I have question about stack on Singly Linked List.
My remove method doesnt return removed node.thats why I am removing the node by myself.
Here is my code.
...
2
votes
0answers
23 views
MVC error handling in Global.asax
I'm trying to implement reliable error handling in my MVC application. I've found a number of articles on this but they all seem to have a different approach, each with their own shortcomings.
So I ...
1
vote
0answers
22 views
Django REST custom methods for generic views
I'm intern and work on a project where I develop DRF API that need to interact with mobile app written by my colleague with Ionic framework.
We are creating new user. My view method is following:
<...
2
votes
0answers
33 views
Waiting for all task to complete while catching exceptions early
I'm working on simulating a number of processing elements (nodes) which do some work in parallel and communicate by exchanging messages. The message exchange is not in the scope of this post, but it ...
4
votes
1answer
68 views
An object for passing a chain of errors in JavaScript
I want to pass errors in errors in order to know exactly the chain of causes, but without augmenting or even reading any stack until this becomes really necessary. And this is how I would achieve this:...
0
votes
0answers
19 views
Insert data into Aurora DB from Kinesis Stream using Amazon Web Services Lambda Function
I have a python AWS lambda function that takes JSON records, checks them to see if they have required keys, and then inserts into MySQL db. The function gets invoked whenever a new record comes into ...
1
vote
1answer
46 views
Handling errors in a Python UDP proxy [closed]
The following (stripped) program receives UDP packets on port 5000 and forwards them to port 5001. It may throw socket errors on startup (e.g.: if the port is already in use), but I am not too worried ...
4
votes
1answer
54 views
Validating attributes of a page in Adobe Experience Manager
I am reviewing the following code written by a fellow developer. I am not an java expert but IMHO i did not feel this is efficient use of exceptions — the reason I feel so is:
The below code throwing ...
1
vote
1answer
69 views
Job queue with threading
On many articles and blogs, I have read that exceptions should not decide flow of your code.
I have wrote the following code using one thread:
...
7
votes
3answers
124 views
Doing an ROP style bind for two functions on the same input in a pipeline
I am working on understanding Railway Oriented Programming (Scott Wlaschin style) in F#. In my example I want to create a pipeline which does some calculation, applies two different functions to the ...
3
votes
3answers
425 views
Lower level exception handling during enumeration
I've got pretty straight forward scenario. I've got a class called FileInformationExtractor and method GetFilesInformation that ...
0
votes
1answer
44 views
Handling user input - follow-up
Original code: Getting name from user, and handling any errors in C
I fixed the bugs. Is there anything else to consider?
...
0
votes
0answers
38 views
General Retry Strategy #4 with TryResult & TryState
Here's yet another version of the retry strategy helper - this is how it looked like before: General Retry Strategy #3 with TryResult.
In this version I added a ...
1
vote
1answer
50 views
Getting name from user, and handling any errors in C
The primary purpose of this program is to practice catching if the user enters data that does not correspond to expected input. Note if the user enters their name as "123", this is valid as it can be ...
2
votes
4answers
131 views
General Retry Strategy #3 with TryResult
I wanted to use the Try helper from @DmitryNogin's General Retry Strategy #2 but each attempt to implement it revealed another thing that is missing.
In my review ...
0
votes
0answers
30 views
Adding contacts to a list using AJAX, with handling for warnings and errors
Given a page that renders a list of contacts, and where you can add more contacts to the list via a form:
When the user fills the form and clicks Add Contact there are 3 use cases that may occur:
...
4
votes
1answer
134 views
Reading lines of a file into a vector of strings
I have to read from a file and store the data inside an std::vector container. The procedure of opening the file, reading and writing onto the container are enclosed in a routine: readData.
Reading ...
1
vote
1answer
49 views
Make sure the user enters a valid floating-point number in C
I would like to know if this is a good way to make sure the user enters a valid number.
...
3
votes
1answer
102 views
General Retry Strategy #2
Previous version
Now supports async operations and cancellation.
Let’s say we copy some file using retry strategy (it might be blocked, etc.). App code comes bellow:
...
2
votes
0answers
35 views
Rust-like “Result” in C - nicer error handling
There are frequently things I miss when using C; one of them is a nice error-handling (exception-like) system. After trying Rust, I realized I could implement something similar in C itself. So here's ...
4
votes
3answers
116 views
General Retry Strategy
Let’s say we copy some file using retry strategy (it might be blocked, etc.):
...
1
vote
0answers
51 views
REST API returning NotFound (404) if record is not found in the database
I'm not really sure what the preferred way is to deal with records not found in the database. Is it better to write a Find method which returns ...
3
votes
1answer
55 views
Avoiding a call to CommandBarControl.Picture
Earlier today, I encountered an Access Violation error when opening the VBE for SolidWorks 2006, while Rubberduck VBA was initializing.
I traced the Access Violation back to an attempt to set the ...
1
vote
0answers
24 views
Functional-style Cocoa XML serializer and object mapper
I'm working on an XML-to-model-object serialization and deserialization library. There are three main design goals for the code:
It should parse XML into and serialize from Cocoa-native collection ...
3
votes
1answer
59 views
Class of file uploading to S3 using boto with multipart supported
I'm writing an app by Flask with a feature to upload large file to S3 and made a class to handle this.
I have some targets in writing code:
Code must be easy to understand and maintain. (Yes, ...
0
votes
2answers
263 views
Check existence of item in collection [closed]
Checking whether an item exist in a collection isn't straightforward in VBA, it requires error checking and during error handling we need to clear the error and also resume code to be able to ...
0
votes
1answer
53 views
SQL message logger run loop
I am learning Java by reading source code of other authors. This Java method handles communication with SQL database. While the code does work several things concern me. For instance the ...
6
votes
3answers
79 views
Parsing excel cells containing line feed characters
This is a direct follow up to Parsing cells containing Line Feed Characters.
Link to sanitized xls on dropbox if test data is needed
Essentially the reports I work with aren't bad -
The issue is ...
9
votes
6answers
1k views
Validation that also returns error messages
My Create, Update and Delete methods should return a ...
4
votes
1answer
38 views
Takes function and throws exception if passed function doesn't throw an exception
The code below is part of a toy test assertion library I've written.
I'm looking for feedback specifically on lines 4 - 9. I'd like to extract them from the ...
0
votes
0answers
26 views
ResponseEntity<Error> bad design
We have implemented this pojo to use in the org.springframework.http.ResponseEntity.
...
3
votes
1answer
57 views
Command sequence executor with error handling
I've recently learned that as a Java developer my methods throw exceptions way too often, even when the reason for throwing is related to a business rule, when returning an error code instead could ...
1
vote
1answer
39 views
Parsing latitude and longitude, using Try[T] to ignore errors
I wrote this question asking about how to implement my error handling while still maintaining functional code and based on 200_success's very interesting note on the spaces, I decided to ...
2
votes
2answers
32 views
Memoizing decorator with retries - now with backoff added! (Part 3)
A continuation of Memoizing decorator with retries, part 2, and related to http://codereview.stackexchange.com/a/133493/47529. I liked my decorator before, but especially in my original use case of a ...
2
votes
1answer
28 views
Stored procedure to swap account holders
I'm doing an exercise, and would like to know if what I'm doing is correct and follows the correct structure for rollback in case a transaction fails. I would like to know as well if my ...
2
votes
1answer
40 views
Elixir / Phoenix login controller, allowing multiple attempts
I have a login method in my controller. I would like to get rid of the imperative "thinking" and write something more functional.
...
8
votes
5answers
324 views
Custom list to avoid out of memory exceptions
The following class is a helper to avoid OutOfMemoryException exceptions being thrown when the list is to large so that it is added onto the large objects heap. To ...
3
votes
1answer
79 views
6
votes
3answers
68 views
Four versions of a database-creation function with different error handling
I'm starting a new, small C project and would like to have the safest, cleanest and shortest error handling code possible.
Here is a comparison of different ways to handle errors in the same C ...
5
votes
3answers
83 views
Memoizing decorator with retries, part 2
A while ago I asked this question Memoizing decorator that can retry and then promptly forgot about it. I more recently saw Python decorator for retrying w/exponential backoff and wanted to add ...
4
votes
2answers
41 views
Error-checking macro to jump to specified label given a failing statement
I'm starting a new C projet and I want to have the cleanest and shortest error checking code possible.
To that aim, I often use two things :
functions return 0, ...
2
votes
1answer
115 views
Python decorator for retrying w/exponential backoff
This is my first decorator in Python! I found some of it on the internet but have tweaked it to our needs.
Here is the couple concerns of mine:
Multiple python version compatibility
Is grabbing the ...
10
votes
3answers
111 views
Userform for getting data from data sheet into a table
I am making a userform that grabs data from a data sheet and puts it into a table:
Grabs the data based on what the user wants (Brand -> Items for brand)
Allows multiple items to be added
Displays ...
1
vote
0answers
24 views
Express middleware to handle errors and send them to Raygun
I signed up for Raygun on Heroku and wrote a middleware in Express to handle the error, however, I am afraid this might block a request from coming through or executing all the way. This article is ...
8
votes
1answer
127 views
Snakes and Letters
This is the "Clean up the words" challenge from CodeEval:
Challenge
Given a list of words mixed with extra symbols. Write a program that will clean up the words from extra numbers and symbols.
...
-1
votes
1answer
40 views
More error-checking
The purpose of this code is to check for errors in my code for a custom shell.
In a previous answer, they say that my code didn't have error-checking.
You need to check the result of every ...
2
votes
4answers
61 views
Throwing exceptions if there is not exactly one box retrieved
(Note: this is originally posted as this SO question )
I'm trying to refactor the error logging and exception throwing into a method.
Original code:
...
1
vote
1answer
69 views
1
vote
0answers
29 views
0
votes
0answers
183 views
Php Ajax script to check server status of sites from db
I am writing a script for a client so hey can check the status of their servers.
The script performs ajax requests to get the data as json then poulates the table with the returned json results.
is ...