All Questions
Tagged with exception-handling or error-handling
822 questions
0
votes
1
answer
50
views
SubImage function implementation in C
This is a follow-up question for Two dimensional gaussian image generator in C, Two dimensional bicubic interpolation implementation in C and A SubPlane Method for Generic Two Dimensional Data Plane ...
5
votes
2
answers
9k
views
Should i throw exceptions in the service layer or repository, and catch it on the controller? [closed]
I read some answers here on stack exchange, but none really "hits the nail on the head" about where to throw exceptions, where I shouldn't and where to catch them.
the idea that an exception ...
8
votes
2
answers
4k
views
See if a specific resource exists in a Kubernetes namespace
I want to have a function that checks to see if a certain resource (deployment, job, cronjob etc) exist in a namespace. Using the Kubernetes Python client, I can create a boolean function (using ...
1
vote
1
answer
885
views
Android APP FTP uploading file implementation in Java
This is a follow-up question for Android APP FTP host profile class implementation and Android APP connect to FTP server in Java. I am attempting to perform the upload operation to specified FTP ...
1
vote
1
answer
63
views
Android APP user registration page implementation
This is a follow-up question for Android APP User class implementation. I am attempting to build a user registering system and this post shows the user registration page implementation.
The ...
1
vote
1
answer
77
views
Android APP Password Strength Assessment class implementation
This is a follow-up question for Android APP User class implementation. I am attempting to create a password strength assessment class which is named ...
3
votes
2
answers
268
views
Custom Error Handler Library in C++
Is this code clean and optimized? When taking memory snapshots, it seems a bit high.
Anything I have done wrong or can do to optimize it?
...
5
votes
2
answers
254
views
Game framework using C++
I'm writing my own game framework and would like to get feedback on the API while I'm writing it. At the moment it's very simple, but I would like some guidance about where to take it.
This is a ...
8
votes
3
answers
2k
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 ...
15
votes
3
answers
15k
views
Verifying the type of an AggregateException's inner exception in a unit test
I've got the following code inside an integration test.
...
3
votes
2
answers
191
views
Library displaying a format with runtime errors, exceptions, and error exceptions present
I have this Library to control errors; I would like if you can evaluate it and make a review of the code, not about the goals of the library:
Everything works for me correctly, but I am also open to ...
-1
votes
1
answer
152
views
Rethrowing unhandled exceptions later in the catching method [closed]
I have a worker class that catches uncaught exceptions and logs them for tracking purposes. However, I do NOT want to swallow those exceptions, nor do I want to abstract them (i.e. losing the stack ...
4
votes
1
answer
52
views
Parsing a u8 separated vector of FromStr from a BufRead
I need to read a vector of e.g. integers from a stream, usually from stdin but sometimes also from a file. The input is always less than a megabyte, and is sometimes separated by commas and sometimes ...
38
votes
6
answers
3k
views
Resolving a link
How can I clean this up?
...
2
votes
3
answers
274
views
ArrayDowncasters Implementation for Downcasting from System.Array to Array of Specific Type in C#
I am working with System.Array and I am trying to convert System.Array objects to array of specific type (such as ...
4
votes
1
answer
889
views
C++ custom exception handling using std::error_category and std::system_error
I want to make my own custom exception handling and I am curious if I am going the right path, maybe some of you could suggest to me how I could improve it? Or maybe I have went the wrong direction? (...
3
votes
1
answer
135
views
Create Table After Deleting Rows Before Desired Range and Filter to Delete All Other Unnecessary Rows
The code below first searches for the first searchText and deletes all rows that precede it to establish a range for a table object. Once the table object is ...
1
vote
1
answer
1k
views
Read and sort 100 numbers from a text file
The program itself reads 100 values from a text file named input.txt. Then sorts those values in ascending order and writes the values to a new file called ...
5
votes
2
answers
654
views
Mysql PDO Wrapper that throws Unique Constraint Exception
The main reasoning behind this PDO wrapper, is that I find myself using unique constraints quite frequently in my designs, and I have ...
5
votes
2
answers
11k
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 ...
0
votes
1
answer
63
views
C++ Error/exception handling [closed]
I know the following code are horrible, so I'd like a review. Criticism are welcome. I want to know what went wrong, and how I can avoid the same mistake in the future.
Version 1
...
2
votes
1
answer
604
views
Modify original JSON few times and post http request
Follow up question from here.
I am working on a project where I need to do below things in Python:
Take few input parameters like - environmentName, ...
7
votes
2
answers
7k
views
Handling parsing failure in Scala without exceptions
I have a Scala (Play!) application that must get and parse some data in JSON from an external service. I want to be able to gently handle failure in the response format, but it is becoming messy. What ...
8
votes
1
answer
287
views
Post json using http and verify whether all actions completed successfully or not
I am working on a project where I need to work with http apis and call them using Python language. Below is what I need to do:
Take few input parameters like - <...
6
votes
2
answers
656
views
Error Code Stack Trace and Propagation Library in C
I've been programming in Go and I enjoy how easy it is to create descriptive errors and propagate them up the call stack. I wanted that sort of ease and consistency in C so I created a small error ...
2
votes
1
answer
408
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 ...
3
votes
1
answer
2k
views
Handle database validation (exists, unique constraint, etc) [closed]
Let's assume you are writing a REST Api with a common structure like Controller > Service > Repository > Database.
In the database there's a table with a column with a unique constraint:
<...
6
votes
1
answer
83
views
Using a linked list as an error type
Background
I've been looking into a few different way to implement error reporting for an embedded system in C and there a couple things that I'd like to incorporate:
A generic and extensible error ...
5
votes
1
answer
757
views
HSTS Recommendations in .htaccess
Please see my previous post in the below hyperlink
I've updated my .htaccess file to account for an HSTS, along with many of the recommended changes. See the ...
8
votes
2
answers
748
views
Binary to decimal (and back) converter in c++
I'm mainly looking for error checking / type safety advice.
main.cpp
...
9
votes
3
answers
3k
views
Error solution: Uncaught TypeError
Uncaught TypeError: document.getElementById(...) is null
I have a single JavaScript file that is connected to multiple pages. The below snippet is a function that is used for a single page. The above ...
4
votes
1
answer
224
views
.htaccess Recommendations
I have a personal website that's used primarily for fun. I upload images, videos and text that I want to share. An HTML submission form accepts questions and string submissions from users, which uses ...
2
votes
0
answers
73
views
Building a GTD Productivity App Designed through Test Driven Development (TDD)
First, thanks so much for looking at my code. Over the past decade, I have tried every task management apps imaginable. I finally realized that the only way I would ever find my perfect productivity ...
2
votes
1
answer
597
views
A method that calls multiple async tasks with error handling, done the right way?
I've got a method, CheckForValue(), that uses named pipes to send a message to another process running locally, and then receive a message from that process, ...
5
votes
1
answer
131
views
Proper Error handling when we expect results from secondary functions
I'm building an android application and I have some second thoughts on some error handling case.
I have a method that gets data from the internet by calling this method:
...
1
vote
1
answer
178
views
6
votes
1
answer
506
views
VBA Error Handling Sub, Working for all subs
The idea is to make an error handling procedure, which prints messages in DEV mode and shows MsgBox in ...
2
votes
0
answers
393
views
Custom MediaController with full screen video image option
I have overridden setAnchorView() of MediaController class to display full screen option icon using below code.The code seems to be working fine in devices I tested but I have few doubts for which I ...
4
votes
1
answer
3k
views
AngularJS recursive function call with $timeout
I have created a recursive function call in AngularJS and just wonder if is there a better way to solve this problem? The code works perfectly.
My code is the following:
...
6
votes
1
answer
213
views
Handling errors in potentially incomplete responses
I am using the library geoip2 to get Geolocation of many IP adderesses
...
3
votes
1
answer
96
views
Sending a CSV file for a client list from a database
What can I improve about this code in order to be production-ready? I'm not worried about security but about errors that could occur.
What exceptions should I catch? I feel overwhelmed about ...
6
votes
2
answers
3k
views
A simple error messaging and logging system via macro(s) in C++
I'm just trying to build a quick and crude error messaging system. It currently looks like this:
...
3
votes
1
answer
557
views
C# Reflection-based CSV Parser
I've been trying to make a C# version of my Java CSV Parser using C# specific idioms.
Here is the full code:
...
2
votes
1
answer
1k
views
Part 2: Send HTTP request for each row in Excel table
This script was previously reviewed here: Send HTTP request for each row in Excel table (Part 1)
I've made the changes that were suggested in the Code Review answers as well as added a few of my own.
...
3
votes
2
answers
324
views
Tic-Tac-Toe in Java
I am currently learning Java; I could really use some help from more experienced programmers.
How can I clean up my Tic-Tac-Toe code? What mistakes have I made? Can I use more exception handling? I ...
2
votes
0
answers
28
views
Is there a better way to handle errors in these functions?
I'm creating a GOLang Linux distribution installer. The architecture is straight forward. I have N parameters and uses them in N installation steps. Summarizing:
Every step implements a interface ...
5
votes
2
answers
2k
views
C++ custom exception class
I am wondering, how can I improve this simple MissingResource exception class? I am using it in my simple game.
...
1
vote
1
answer
214
views
Handling multiple try-catches in a for loop
Good day! I would like to know if this is possible to be refactored into a cleaner code.
The reason I'm doing it like this is to catch the column that the error appeared on and then potentially output ...
4
votes
0
answers
78
views
Error handling best practices using a custom error handling module
I am trying to learn how to effectively use error handling in my code. To do this, I have created a class inside main.py which reads the value of a specified curve ...
0
votes
2
answers
59
views
Bugs - Program that Creates a Directory in C
I have the following code that creates a directory in C. I tested it multiple times, reviewed it a few times and it looks fine at the moment.
What I really wanna know is what bugs does it have and ...