All Questions
Tagged with error-handling exception
1,621
questions
-1
votes
0
answers
43
views
Java exit status codes based on application warnings vs errors [closed]
I'm developing a Java application where the exit status codes need to reflect the following conditions:
Exit with status code 0 if no errors or warnings occur during execution.
Exit with status code ...
0
votes
1
answer
40
views
How to Implement a Lockfile to Prevent Multiple Instances of a Java Application [duplicate]
I am working on a Java application, and I need to ensure that only one instance of the application runs at any given time. I have read that this can be achieved using a lockfile. The idea is that when ...
0
votes
1
answer
34
views
What exception should be raised when the user calls a function with an argument that is considered an invalid choice?
Let's say I have the following code:
#!/usr/bin/env python3
from torch import Tensor
from typing import Literal
def reduce(x: Tensor, reduction: Literal["mean", "sum", "none&...
0
votes
1
answer
48
views
Don't report a fetch timeout as an uncaught exception
I use:
fetch("/test", { signal: AbortSignal.timeout(2000) })
.then(r => r.json())
.then(r => { console.log(r["data"]) });
with the method from Fetch API request ...
0
votes
0
answers
41
views
How properly handle error exception in try and catch block?
I have a problem with the flow of error handling. I have a try and catch block, and I need to ensure that the try block contains the logic for what should be executed. Specifically, a ticket should be ...
0
votes
1
answer
18
views
php 8.1 + mysql 5.7: error handler in stored procedure dosen't work
I have a stored procedure with which I try to insert some data into two tables but I don't want to insert duplicate keys. So I wrote the following procedure with the handling of error 1062: duplicate ...
0
votes
0
answers
13
views
Catch all imports into decorator
Context
I currently have python files like this:
import module1
import module2
from module3 import email_on_error_decorator
@email_on_error_decorator
def main():
...
if __name__ == '__main__':
...
0
votes
1
answer
41
views
KeyboardInterrupt is not catched when blocking work is done
To stop the following code one will need to press Ctrl-C twice, however the second raised KeyboardInterrupt exception is not catched by the inner try-catch inside the start_consuming method.
import ...
0
votes
0
answers
25
views
Best practice to send error message in a web app with springboot?
So, I was wondering if its ok to have something like this in the Controller (for each field that may need it):
if(!formFile.getContentType().startsWith("image/")){
...
4
votes
0
answers
89
views
benchmarking exceptions vs error by value
I've decided to measure the performance difference between 2 approaches for handling errors:
return by value (sum of errors)
throw
I've written a simple benchmark for calculating a sum of a large ...
0
votes
0
answers
11
views
Why re-thrown error from catch block is different then it thrown from try block?
So if we throw a error and there is no try-catch block it will go to the call stack and will be considered as an unhandled exception and which may crash the system.
But when we have the try-catch ...
0
votes
0
answers
359
views
Laravel 11: Handling exceptions in app - Reportable not working
I'm having trouble with the reportable function in Laravel 11, and I'm not sure what's wrong.
Here's the code I'm working with:
use App\Exceptions\UnauthorizedApi;
use Illuminate\Foundation\...
0
votes
2
answers
277
views
How to catch a Reactor RetryExhaustedException?
I have code throwing a reactor.core.Exceptions$RetryExhaustedException and I would like to catch that specific exception.
However, this RetryExhaustedException is not a public class, it is a package-...
2
votes
3
answers
214
views
Spring Cloud Gateway MVC exception handling
I'm writing a API Gateway app built using Spring Cloud Gateway MVC. I'm using a custom CircuitBreaker filter that can timeout when backend requests take too long.
I'm seeing that when the request ...
1
vote
1
answer
2k
views
Why does my Laravel 11 project not use my exception handling?
I'm trying to handle some exceptions from Passport in my Laravel 11 project but for some reason any renderable exceptions (Passport and other exceptions) I add to the ->withExceptions part of my ...