Skip to main content

All Questions

5 votes
5 answers
616 views

Imagine I have a function like this (written in Java): void sayHello(String firstName, String lastName) { if (firstName == null) { throw new IllegalArgumentException("first name is ...
J-bob's user avatar
  • 357
12 votes
6 answers
4k views

The basics: what I know 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 ...
Eternal's user avatar
  • 245
4 votes
2 answers
504 views

I am trying to write a backend for use with a completely text based UI for one shot operations (eg. python scriptname arg, executes that argument and exits) and a GUI using the curses library for some ...
Hugo Schongin's user avatar
3 votes
3 answers
554 views

I am starting a project in Java and ran into the following situation. The application requires a persistence layer for a certain document type. This could be a MySql database, an AWS Dynamo DB ...
Matias Grioni's user avatar
1 vote
4 answers
557 views

In order to make sure methods fail fast under invalid arguments, I usually do validation at the start of a method. If I'm verifying multiple predicates, this leads to a few lines of checkNotNull or ...
EarthTurtle's user avatar
4 votes
5 answers
3k views

I have the following method, which needs to return a List, but exceptions might occur along the way, and I don't want to handle them in my application, mainly because I don't even know how to handle ...
MasterTJ123's user avatar
0 votes
2 answers
735 views

We manage a backend application behind a FastAPI REST controller with multiple endpoints. A member of our team decided to use a middleware on the application which parses the body of the response for ...
Blue_Elephant's user avatar
5 votes
7 answers
587 views

Consider the following scenario. I have an interface IService: public interface IService { void DoSomething(); } with an implementation: public class Implementation : IService { // This might ...
Codisattva's user avatar
5 votes
6 answers
2k views

A long time ago I was in a class and the professor had us write individual exception handlers for every possible error. This seems almost impossible to do when developing large pieces of software ...
FourierFlux's user avatar
1 vote
5 answers
255 views

Consider the two following examples: public Something fetchSomething(String key) { if(somethingsMap.containsKey(key)) { return somethingsMap.get(key); } throw new ...
steros's user avatar
  • 121
3 votes
1 answer
829 views

I have been tasked with the title above. There is currently zero exception handling. There are 100+ threads, all created from main(). Exceptions won't percolate up to main() - they won't leave the ...
Mawg's user avatar
  • 4,308
1 vote
2 answers
2k views

how could we advise the web client about a non-recoverable exception thrown by the persistence adapter ? At first sight, I would define a domain exception to be thrown by the persistence adapter and ...
hjoly's user avatar
  • 21
0 votes
1 answer
307 views

We have a GraphQL server which sends data to the front end client. We have other tenants who will use our sever and host their code. I want to create a system where they all can create any custom ...
user415612's user avatar
0 votes
1 answer
141 views

I need some guidance on how to send error responses to client from WebAPI controller for an update operation. I need to check if data is changed and if it has duplicate data. I have service class that ...
Sunny's user avatar
  • 945
2 votes
1 answer
227 views

Given that there are no checked exceptions in Kotlin, are Result types the correct way to indicate an exception occurred to the caller? For example, I have the following function in my code: suspend ...
Adam's user avatar
  • 272

15 30 50 per page
1
2 3 4 5
43