jreicherHeh. cheeser the log of the above has the wrong nick for the bot. :)
* pebble joined #java
* PyR3X joined #java
* Fiji joined #java
* kusanagi joined #java
* Inline joined #java
* Gaz7051122720067 joined #java
* lostlazy_ joined #java
* marcel1 joined #java
* enoq joined #java
enoqlet's say you have some values in your configs that you need to set and they're absent due to a mistake, do you throw a custom exception here or reach for something like IllegalStateException?
enoqthere's nothing to recover from really
Inlineyah, let the user know the state is not ok
Inlinenot because of something wrong but rather something missing/absent
enoqso no RequiredConfigValueMissingException
Inlineyah
enoqI mean you can always explain the issue in the message
Inlinethat exception by name already tells much
InlineI don't think you want to spout more than required polluting the vision of the user etc.
enoqnot sure if this is sarcasm or enlightenment
Inlinefail early, fail hard, fail loudly
Inlinehmmmm
Inlinethere's no rule fail verbosely
enoqat least my gutt feeling is that introducing custom exceptions makes sense if they could be caught
Inlineright
Inlineif it's domain specific anyway....
Inlinecatch what you can
Inlineand handle it if you can, otherwise err as generic
* five618480339176 joined #java
BombeSometimes I do both: class RequiredValueMissing extends IllegateStateException {}.
* henbruas joined #java
* Tenchi joined #java
* fstd joined #java
* X-Scale joined #java
* MonsterAbyss joined #java
* MonsterAbyss joined #java
* MikeBux joined #java
deeboanyone aware of some sort of "remote data repository" for spring data repositories over spring-data-rest ? just to avoid writing the client as well
* MonsterAbyss joined #java
* Pixi` joined #java
* MikeBux joined #java
* fgarcia joined #java
dreamreal~gpt anyone know of a spring client library for REST semantics, sort of a "remote data repository"?
dreamrealThe problem is that it's not a "repository" - it's a rest call, and there's not a direct equivalent for repository semantics. RestTemplate > WebFlux, anyway.
dreamrealYou could get closer with graphql, but only for read semantics.
Parajdbc-over-http sounds like something people used to do back in the IT bubble days
dreamrealthey didn't, though: it sounds like something that would have been tried, but getting connections over RMI was never allowed :D
* kusanagi joined #java
* fgarcia joined #java
* lostlazy_ joined #java
* Betal joined #java
* tazle joined #java
* PyR3X joined #java
* nani joined #java
* GreenResponse joined #java
* pr3d4t0r joined #java
* Ragnor joined #java
jreicherenoq: did you read the JDK definition of IllegalStateException? I don't think it's for what you have in mind. Also, why do you want to throw an exception at all? Does it help your code somehow?
enoqjreicher, thank you, sounds like I need something else; as for the exception itself: yes, I can't proceed with the script invocation without the target API configs so exiting with an error seems fine
* MonsterAbyss joined #java
jreicherHmm. How are you loading the configs? If you're using a library of some kind it'll probably have exceptions already.
* jamezp joined #java
* sa02irc joined #java
dreamrealWhy not throw RuntimeException or a derivative of it
enoqjreicher, no library; I know there things like Spring provide an easy way to map that onto POJOs but it's a very simple script
enoqdreamreal, that'd be the obvious case for defining a custom exception; just wondering if it's worth the ceremony and if there's something built in that works for these cases
enoqcould also through a generic RuntimeException("message here") I guess
dreamrealI'd say build the custom exception, personally; if that's "ceremony" your metric for ceremony's set very oddly to me
dreamrealinodes are CHEAP
enoqthanks
* tronexte joined #java
* rvalue- joined #java
* OmniRadix joined #java
* Nav94 joined #java
* Inline joined #java
* kathadris joined #java
* Inline left #java (No boundaries on the net!)
* m joined #java
* jreicher joined #java
* X-Scale joined #java
* AMcBain joined #java
* Aedil3 joined #java
* dob1 joined #java
* MonsterAbyss joined #java
* MikeBux joined #java
* magla joined #java
* hwpplayer1 joined #java
* s3 joined #java
jreicherenoq: in my opinion, since you're not using a standard library, and since it sounds like your program can't proceed with a malformed config, this boils down to the nicest way for your code to terminate. You could always call exit(), but allowing main to throw an exception might be nicer.
jreicherWhat you might like to consider doing is writing the presence of the config as an assert, and then enabling the assertion mechanism. The rest will be taken care of for you.
jreicherAs I said, it feels like a coding style question.