We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [exceptions]

An exception is an occurrence in an application process that requires deviation from the program's normal flow.

9 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
242 views

Different kind of checked exceptions - Guarantee to only throw X

It is a widely held position that checked exceptions as implemented in Java are a bad idea. If you mark a method as throwing, calling code has to either catch the exception, or be marked as throwing, ...
3
votes
0answers
166 views

Design interfaces with annotated exceptions, but reduce the need for exception wrapping / re-branding?

I am designing a library with a bunch of interfaces with annotated exceptions. (The example is in (pseudo)PHP, but I am sure one could do something equivalent in Java or other.) For now, the ...
2
votes
0answers
88 views

Handling exceptions in multiple-issue CPUs

From what I read, VLIWs execute instructions in bundles, i.e. the CPU loads a bundle of instructions and dispatches them all at once. This is possible because the compiler scheduled instructions in ...
1
vote
1answer
57 views

What kind of exception of SPL is best suited for file exceptions?

When I use the Exception provided by the SPL the options are limited. So it's hard to pick which exception would be best suited to handle File exceptions. I know the best scenario is to write my own ...
0
votes
1answer
50 views

Handling Currency getInstance throwing IllegalArgumentException

I have a class with a (simplified) method which returns a string like this : private String doStuff(String currencyCode, BigDecimal amount){ StringBuilder sb= new StringBuilder(); ...
0
votes
1answer
428 views

Where would you handle exceptions: controller, service, repository?

I have been having this dilemma from time to time whenever I have to design or start a new project from scratch. I particularly like how Spring framework is organised in terms of classic software ...
0
votes
0answers
123 views

How to handle error responses in a chain of CompletableFutures?

I have a long chain of completable futures in my project, with each step calling a backend API, which can give multiple error responses and one success response. Now, after parsing the response, I ...
-1
votes
1answer
52 views

Handling RuntimeExceptions thrown from Services and Libraries

I am working on a ReST based service which calls other ReST based services and also deals with Persistence in a database. So a typical call might look like Get some data from the database. Make a ...
-4
votes
0answers
67 views

Throwing exceptions versus collecting errors

I have written a parser where the input can contain a lot of different errors. No I am wondering what is the better approach here. Imaging a call stack like this: Parser.parse(input) -> ...