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.
831 questions
0
votes
0
answers
34
views
Remove error from Inputfield when user input value in field in React
After submission if there are any error, on user inputfield typing wants to remove that error.
My Approach.
...
1
vote
3
answers
158
views
Is this exception handling missing anything?
This is the code. I'm uncertain about the last block.
...
8
votes
4
answers
1k
views
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 ...
6
votes
3
answers
273
views
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 ...
0
votes
3
answers
238
views
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. ...
4
votes
1
answer
176
views
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?
...
12
votes
2
answers
2k
views
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, ...
3
votes
3
answers
773
views
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 ...
5
votes
2
answers
982
views
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 ...
3
votes
2
answers
100
views
Validating a web crawlers page visits with a decorator
I am writing a crawler that is going to end up in production and I was trying to come up with a way to validate its page visits. It scrapes asp.net pages so each scraping process involves a few ...
5
votes
1
answer
347
views
Generic container wrapper type with a default underlying buffer
I've come up with a type that allows me to encapsulate any container class (that supports std::pmr::polymorphic_allocator<T>) with a buffer and a memory ...
3
votes
1
answer
110
views
Scraping website with Python and Selenium to collect data from dynamic website
Summary:
The code scrapes the website and collects the data to store it in CSV. It also downloads selected information that is available for download in PDF format. The details and the entire code are ...
2
votes
1
answer
77
views
Understanding how to properly create a stored procedure that only does INSERT from sourcetable to targettable with dynamic sql
Background and use-case
I need to create a stored procedure where the input parameters will be: @sourceTable, @targetTable, @compositeKey. I'm using available fields for the composite key, since I ...
2
votes
3
answers
2k
views
Math calculation JavaScript. Am I using Objects correctly? Can I use methods / functions to shorten my code further? Also error logging?
Context- CRM system, front-end form.
Requirement- Within a form users have to give a rating to a section based on user inputs, each rating has different weighting. The rating is stored in an option ...
4
votes
2
answers
217
views
Beginner's attempt at TicTacToe
This is my attempt at making a basic TicTacToe game to play against another human player or a computer controlled opponent. The project was a lot harder for me than I initially thought it would be!
I ...
5
votes
2
answers
296
views
Kotlin: scoped functions with try/catch support
I'm working with Kotlin for some time. Compared to Java it's more concise. Still it has some legacy inherited from Java. For example the try-catch-construct. Though it has been upgraded from a ...
0
votes
1
answer
224
views
Handling exceptions of FileInputStream and XSSFWorkbook
Can you tear my code apart with code review comments?
Below is a simple method which reads an XLSX file and does some stuff with it.
I use FileInputStream and ...
1
vote
1
answer
95
views
C interface exception handling with C++ implementation
Whilst developing a bigger project, I was in need of having basic error handling inside the context of a C interface.
I came up with the following solution.
...
3
votes
1
answer
116
views
Error Reporting in WPF app
I want to add an error reporting feature to my WPF app. I have the view for it created; I just need to know when to call it. I am used to web development and this is my first WPF app.
...
2
votes
1
answer
135
views
Outcome error handler, inspired by boost's outcome namespace
I'm creating a little library for my pet project that is inspired by Boost's outcome namespace. The main reason why I didn't want to use the Boost version is that I don't like the overhead of ...
-3
votes
1
answer
109
views
Catching any exception and actually do something with it [closed]
Say I have a framework, which should catch any exceptions raised from user code, and actually do something with it, such as converting it to a return value
...
3
votes
2
answers
357
views
atomic spinlock mutex class
This here is the follow-up to this question. I was recommended to implement a Lockable type (similar to std::mutex) that can work with ...
1
vote
1
answer
252
views
Function to return a file name from lists/dictionary constants
I'm reworking a set of two functions that return a text file name, constructed from a string argument and string variables from a module called inventory. It seems ...
5
votes
4
answers
4k
views
Dividing two numbers then handle the divide by zero exception with try/catch
I am new to coding, I hope you can help me to improve my code :)
First of all: The code works correctly.
...
3
votes
2
answers
157
views
Spring boot shop application with error handling
I'm writing a simple online shop using spring boot, for learning purposes. Right now I have purchasing-service and a product-service. The purchasing-service makes requests to the product-service via ...