54,256 questions
-1
votes
0
answers
44
views
Infrastructure storage exception handling in DDD-ish app [closed]
I have a DDD-ish application where a long-running business process is split into workflow steps.
Each step is idempotent and starts from a message handler.
Very simplified flow of a single step:
...
Best practices
0
votes
3
replies
156
views
Can I modify the Message of a caught Delphi Exception object and then re-raise it?
The title says it, but here is an example:
try
// ...
raise EFileNotFoundException.Create('File not found!');
except
on E: EFileNotFoundException do begin
E.Message := Format('"%s":...
1
vote
1
answer
55
views
how to make socket server propagate exceptions up to TaskGroup where they're started from?
How to make exceptions thrown from a socket server running in a task group task be propagated up to its parent TaskGroup? With given example, I'd expect to see the error raised from ...
Advice
0
votes
2
replies
55
views
Better solutions for reseting 'is_running' flag to 0 when an exception occurs during code execution in python
I have a python code with below structure:
try:
# Check if ETL is running
check_isrunning_sms_journals = "select nvl(d.is_running,0) as is_running from running_etl_table d where ...
Advice
0
votes
0
replies
39
views
What should I replace a newline character with when newlines aren't allowed?
I'm building a hobby chess engine that communicates through the UCI protocol. This is communication done through standard out/in of the program, with each line representing a single command.
One of ...
4
votes
1
answer
102
views
Java ExecutorService detect asap thread fail
I have to run x asynchronous threads , which can last several minutes each.
They ALL have to terminate properly without exceptions.
If one fails I have to stop them all immediately and not wait ...
2
votes
1
answer
49
views
Calling `sys.excepthook` manually with `sys.last_exc`
The signature of sys.excepthook is
sys.excepthook(type, value, traceback)
so a natural way to call it is
sys.excepthook(sys.exc_type, sys.exc_value, sys.exc_traceback)
But as of Python 3.12, ...
Best practices
0
votes
1
replies
93
views
Java exception handling (best practices)
I'm starting out with Java and Spring Boot, and I have a fairly simple question that always raises doubts for me, as I always like to follow best practices.
I have a Controller layer where I create ...
-1
votes
1
answer
69
views
Why does asyncio.gather() sometimes hang indefinitely when one of the tasks raises an exception? [closed]
I'm experimenting with Python’s asyncio to run multiple coroutines concurrently.
However, in some cases asyncio.gather() seems to hang forever when one of the tasks raises an exception — even though I ...
0
votes
1
answer
115
views
Spring Boot 3.x — @RestControllerAdvice not catching custom exceptions
I recently upgraded to Spring Boot 3.5 (Jakarta packages) and noticed my global exception handler isn’t being triggered.
@RestController
public class UserController {
@GetMapping("/test")...
3
votes
1
answer
146
views
How to catch EXCEPTION_PRIV_INSTRUCTION from RDPMC directly in Assembly (and without SEH)?
I'm experimenting with measuring CPU's instructions latency and throughput on P and E cores using RDPMC on Win 11, something like that:
MOV ECX, 0x40000000 ; Instructions Counter
RDPMC ; Read ...
1
vote
0
answers
84
views
exception handling on different architectures
I have two questions about exception handling.
I read exception handling code of some real-time operating system (I mean assembly code). I note that on some architectures we allocate on stack more ...
0
votes
1
answer
59
views
WhenAll nested in WhenAny (or WhenAll with timeout) [duplicate]
The first exception does not block the execution:
public static async Task Main()
{
await Task.WhenAny(
Task.WhenAll(
Task.Run(() => throw new Exception(&...
1
vote
1
answer
71
views
How to handle error during customized scoped dependency injection
I have applied the multi-tenant location for EF Core database applying customize schema per tenant in my ASP.NET Core Web API project.
To do that the client send request through the API by setting ...
3
votes
1
answer
418
views
Android project throws FileAnalysisException in onCreate method in Main Activity when adding OkHttp library
I've created an Empty Views Activity project in Android Studio, but as soon as I add the dependency in build.gradle.kts and try to launch the app, it throws an exception (see output). No code is ...
0
votes
1
answer
146
views
Getting Access violation exception thrown when setting up raylib with visual studio 2022
I wanted to learn game dev in C++ lately, so I decided to setup raylib in Visal Studio 2022 by following a tutorial online. I downloaded the latest release from the raylib github repo and configured ...
1
vote
1
answer
109
views
PPP_support.h error() function terminates program without printing custom message
I'm working through Bjarne Stroustrup's "Programming: Principles and Practice Using C++" and using the PPP_support.h file from the official website https://www.stroustrup.com/PPP_support.h
I ...
1
vote
1
answer
148
views
Can the compiler elide a const local copy of const& vector parameter?
Consider these two functions:
int foo(std::array<int, 10> const& v) {
auto const w = v;
int s{};
for (int i = 0; i < v.size(); ++i) {
s += (i % 2 == 0 ? v : w)[i];
...
0
votes
1
answer
296
views
How to deal with "DDGSException: No results found."
I tried to use DDGS to search for images in Jupyter Notebook with fastai, but the search seems to be not very stable. Most of time there turned out to be an ERROR:DDGSException: No results found.I ...
0
votes
1
answer
74
views
Catching an Alignment Check Exception on Windows
I'm trying to perform a misaligned memory read / write and catch it inside a __try and __except block.
After setting the RFLAGS.AC bit to 1, I perform the misaligned read which causes my program to ...
1
vote
2
answers
79
views
`Option.defaultValue` not working properly in f# when raising exception
I am trying to combine Option.defaultValue with failWith to get exception for None values:
printf "%A" (Some 1 |> Option.defaultValue (failwith "Error"))
But this code raise ...
1
vote
0
answers
69
views
How to receive the request object from webhook, Clientdisconnect exception. `Client disconnected before the server could read the request body`
I'm integrating the LINE messaging API with bot server. Likewise the Whatsapp Business API. To create the public URL, I used ngrok. Now whenever the user send the message to us, the LINE server send ...
4
votes
0
answers
128
views
Can I peek at an uncaught exception in the destructor of an object undergoing unwinding?
For debugging purposes, I would like to log the exception that is causing stack unwinding that lead to destruction of specific object. Something like this (pseudocode, obviously insufficient and not ...
1
vote
1
answer
150
views
Module loading logistics failed: file logistics/security/ir.model.access.csv could not be processed:
Exception: Module loading logistics failed: file logistics/security/ir.model.access.csv could not be processed:
No matching record found for external id 'model_logistics_order' in field 'Model'
No ...
0
votes
1
answer
54
views
I got java.io.FileNotFoundException when I call URL.openStream()
I have an URL for file downloading and it works perfectly on my Samsung Galaxy S10 (running Android 12), but the same app throws java.io.FileNotFoundException on my Google Pixel 9 with the latest ...
0
votes
1
answer
49
views
Can pathlib.Path().is_file() return True and open('foo', 'r') still raise an IOError?
Is it possible that pathlib.Path().is_file() returns True and the file is nevertheless not readable, i.e., open('foo', 'r') raises an IOError?
0
votes
0
answers
36
views
Error: "Unable to set the next statement. The attempt to unwind the callstack failed." in VS2022, but VS2019 works
I am unable to move the next statement pointer in VS2022 outside the catch block if an Exception is thrown.
If I run this code in a VS2022 (17.14.4) Unit Test Project (.Net 4.81), set a break point on ...
1
vote
0
answers
99
views
How to cancel a gRPC client streaming call cleanly without triggering RpcException, ObjectDisposedException, or InvalidOperationException?
I'm working on a gRPC client that continuously streams data (such as images) from a server. I use a CancellationToken to stop the stream when needed. While cancellation works, I consistently see ...
0
votes
1
answer
43
views
Why PersistenceException is thrown rather than EntityExistsException while trying to persist the same entity twice
I have set up a very simple Java web project (using NetBeans' Web Application template). It is deployed on Payara 6.2025.7 with a H2 database as a JTA data source.
I can't get EntityExistsException ...
1
vote
1
answer
96
views
Python asyncio/Telethon script suddenly stopped working after VSCode restart (Python 3.9.6 on macOS 12.7.6)
I have a Python script using asyncio (for Telethon) and until recently, it was running just fine in a Terminal inside VSCode.
However, an extension install prompted a VSCode restart and now I can't ...
1
vote
1
answer
73
views
Is it right to raise an error in except block in python? [closed]
I often see code like this:
try:
some_operation()
except Exception:
logger.error("An error occurred while running the operation")
raise Exception("A custom message")
...
1
vote
1
answer
113
views
JNDI Lookup Failing with Default Settings
I'm trying to implement a basic database web application in Netbeans using Java Server Faces and a Java Database. But whenever I try to deploy the application, I get the following error message:
...
0
votes
1
answer
106
views
Error NoClassDeffoundError: jakarta/servlet/ServletException with Spring Boot 3.4 and spring-boot-starter-webflux
I have the following configuration:
spring-boot-starter-parent: 3.4.7
spring-boot-starter-web (excluding spring-boot-starter-tomcat in order to have netty instead Tomcat)
spring-boot-starter-webflux`
...
0
votes
0
answers
71
views
C++Builder - linker errors trying to use __throwFileName and __throwLineNumber
I am trying to catch an exception and get the line and source file where the error occurred. I was using __throwLineNumber and __throwFileName and it compiles, but I am receiving linker errors:
[...
0
votes
1
answer
203
views
Memory exception when adding a node to a Win32 TreeView (in code that has been working for 2+ years!)
I am getting a memory exception in (unchanged) code that has been working for 2+ years (code is unchanged, in a Git repo).
Here's the code that is causing the exception:
HTREEITEM getTreeNode(HWND ...
2
votes
1
answer
295
views
How to fix DioException [connection timeout] in Flutter with AlgoliaSearch or Dio package?
I'm trying to fetch data using Algolia Search in Flutter and the data does get fetched the problem is that it gives the following error:
DioException (DioException [connection timeout]: The request ...
4
votes
1
answer
136
views
std::terminate is called due to uncaught exception inside of joined thread
I am wondering why exceptions inside joined thread invoke std::terminate and detached threads do not invoke std::terminate.
Consider following snippet that triggers std::terminate. If we replace t2....
2
votes
2
answers
126
views
Can an object with a throwing destructor escape a "..." matcher?
According to cppreference
The catch (...) handler matches exceptions of any type. [...] This handler may be used to ensure that no uncaught exceptions can possibly escape from a function that offers ...
1
vote
2
answers
95
views
Handling Missing Dependencies Gracefully in Python Modules
I'm currently working on a modular python framework. The current dilemma is, that one module has a set of submodules that have vastly different dependencies, and a user usually would only use one of ...
0
votes
0
answers
155
views
C++ Catch Exception without debugger
I'm currently working on a C++ application compiled using Microsoft Visual Studio 2022. I've been encountering an issue where the application crashes during shutdown. These crashes don't visibly ...
2
votes
3
answers
160
views
Understanding the destructor call in item 8 of Effective C++, Third edition
In Effective C++, by Scott Meyers, item 8, there is a suggestion to wrap (using RAII) an object that has a close method that may throw, to automatically call close in the destructor, but since ...
4
votes
2
answers
270
views
Retrieving unknown exception information
How can I get information about an unknown exception, like in the code below?
void foo()
{
throw 'A';
}
...
try
{
foo();
}
catch (const std::exception& exc)
{
std::cout << exc.what();
...
0
votes
1
answer
200
views
Where exactly should exceptions be caught to get useful error reporting from this scenario?
I think I understand the basics of exceptions:
If a function cannot perform its assigned task, it can signal it by throwing an exception,
When writing a function, one must make sure it is exception-...
1
vote
1
answer
195
views
Getting exception "unknown Signal" with realloc in C [closed]
I have a function which I give a char** input. Inside the function I am calling realloc. I am calling the function multiple times without any issues, but it always crashes at the same point with
&...
0
votes
2
answers
254
views
How to set number of reconnection attempts in `node-redis` library?
I'm tinkering my API on node.js with caching, supporting graceful degradation. While testing app with redis container being disabled, node-redis is trying to reconnect every five seconds. The problem ...
1
vote
1
answer
81
views
How to raise an error when converting a non-numeric string to float
I'm prompting the user to enter a float. Afterward I try to convert the received string to float. In case the user has entered an invalid value (string with special characters, etc.), which can't be ...
0
votes
1
answer
89
views
Laravel Modular Monolith custom Exception Handler
We are adopting a modular monolith approach to our application development and everything is fine thus far. However, when implementing a custom exception handler for each of module this becomes quite ...
0
votes
1
answer
126
views
Java spring boot exception mapper is very inconsistent with REST API
I am trying to implement an Exception mapper in Spring Boot application to capture all the exceptions thrown by the REST API.
The exception mapper is working inconsistently which means for exception ...
-1
votes
1
answer
135
views
EXC_BREAKPOINT breaking tests in Xcode 16.4
In trying to run tests on my app in Swift, I am encountering a problem. I do not have any breakpoints set, and yet, the execution of the tests is being interrupted on the line containing "throw ...
-3
votes
1
answer
104
views
How to make a custom error message for Service Unavailable in FastAPI? [duplicate]
I'm running my app like so:
uvicorn main:app --host 0.0.0.0 --port 8080 --workers 2 --limit-concurrency 10
Versions are:
fastapi==0.103.2
uvicorn==0.34.3
When I start slamming it, I get the expected ...