All Questions
Tagged with exceptionhandler or exception
54,257 questions
Best practices
0
votes
3
replies
126
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":...
Advice
0
votes
2
replies
43
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 ...
4
votes
1
answer
97
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 ...
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 ...
0
votes
1
answer
100
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")...
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 ...
1
vote
1
answer
65
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 ...
0
votes
1
answer
131
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
140
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
73
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
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 ...
1
vote
1
answer
143
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
47
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?
1
vote
0
answers
94
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 ...
1
vote
1
answer
94
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
108
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
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:
[...
2
votes
1
answer
275
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 ...
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 ...
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 ...
4
votes
2
answers
265
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();
...
1
vote
1
answer
192
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
&...
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
125
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 ...
-3
votes
1
answer
98
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 ...