Questions tagged [error-handling]
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.
730 questions
8votes
4answers
996views
Python Exception Monitor
I have built a data pipeline in Python (3.12). It typically processes hundreds of thousands of files and runs for several days. A particular pipeline function calls external web APIs that sometimes ...
5votes
2answers
169views
Design By Contract Library in C++
I asked this question on StackOverflow, and got exactly the answer I needed at the time. I am now here to ask - Is this a good design? The motivation for writing up this library: my shop writes ...
6votes
3answers
241views
GitHub Label Management with GraphQL, Requests, and Loguru
I've developed a Python script that automates the management of GitHub labels. It utilizes both the GitHub GraphQL API (to fetch label data) and the REST API (to update, delete, and merge labels). The ...
0votes
1answer
85views
Implementing safe custom exception [closed]
I was trying to come up with some design to subclass built-in exceptions. For simplest case I used something like this: ...
0votes
3answers
175views
Java exceptions that show the message when converted to String
I’m working with custom exceptions in Java for stack operations. However, I’m unsure if the exception handling is being handled properly, especially in terms of how exceptions are thrown and caught. ...
5votes
1answer
88views
Find food related words in German: Seeking Feedback on Concurrency and Code Organization
I'm developing a pipeline that processes unknown ingredient data from the OpenFoodFacts API. The goal is to find valid German words that are not yet in their taxonomy. The tool performs the following ...
4votes
1answer
144views
Replace node type in Drupal
In Drupal 11 or greater, this code is used to change the node type of a node. How would you improve the code if at all? ...
8votes
1answer
261views
Errors as values and Generic Option, Result types in C++
I wanted to get an in-depth view of both Templates and Concepts in C++, so I made this library. https://github.com/Hernanatn/errores-- I'd like to ask: is this a proper use of concepts? is the code ...
10votes
2answers
2kviews
Robust error handling mechanism in C++ (safer than std::expected)
I've been looking into and experimenting with various paradigms for error handling in C++. My goals for a robust error handling mechanism would be: Enforce handling the error cases (in other words, ...
4votes
1answer
86views
Result class to get either value or error
Recently, I had written a Result class. Basically I wanted a function to return result value on success and some error code on failure. ...
1vote
0answers
34views
How to optimize authentication and authorization, API calls in a task management frontend application?
Let me give a brief explanation of the mini-application I've designed using Angular : A simple login page that requires user email and password as credentials. Once logged in, the user is moved to a ...
3votes
3answers
725views
Capture multiple errors before raising an exception
I have a scenario where I need to store values from some environment variables (names of which I cannot control). My first run at this was pretty basic, however this is not usable as an exception ...
4votes
3answers
673views
Error handling for singly linked list in C
I have seen many list implementations in C in this site; I know its been asked many times. I need some advice regarding: Quality of my code, especially my list library. How to handle errors in main (...
4votes
2answers
953views
Simple load balancer
I would like to know the possible improvements in design and concurrency of the following load balancer: ability to add/register new instance keep max of 10 instances for load balancer forbid ...
4votes
3answers
749views
Implementing strscpy(): Is using errno as a negative return value a bad practice?
strscpy() is similar to the standard strncpy() except that it always writes a valid null-terminated string (unless ...