ByteCode.News
Submit RSS Atom Sign in

Back to the channels

#java

  1. * Munnu joined #java
  2. * domicron joined #java
  3. * jreicher joined #java
  4. * tabmow joined #java
  5. * ferdna joined #java
  6. * jreicher joined #java
  7. * michele3 joined #java
  8. * wedr joined #java
  9. * fgarcia joined #java
  10. * fgarcia joined #java
  11. * fgarcia joined #java
  12. * BytesAndCoffee joined #java
  13. * fgarcia joined #java
  14. * m joined #java
  15. * fgarcia joined #java
  16. * fgarcia joined #java
  17. * fgarcia joined #java
  18. jreicher javabot: welcome back
  19. javabot jreicher, what does that even *mean*?
  20. jreicher Only that I missed you. Never mind.
  21. jreicher Heh. cheeser the log of the above has the wrong nick for the bot. :)
  22. * pebble joined #java
  23. * PyR3X joined #java
  24. * Fiji joined #java
  25. * kusanagi joined #java
  26. * Inline joined #java
  27. * Gaz7051122720067 joined #java
  28. * lostlazy_ joined #java
  29. * marcel1 joined #java
  30. * enoq joined #java
  31. enoq let'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?
  32. enoq there's nothing to recover from really
  33. Inline yah, let the user know the state is not ok
  34. Inline not because of something wrong but rather something missing/absent
  35. enoq so no RequiredConfigValueMissingException
  36. Inline yah
  37. enoq I mean you can always explain the issue in the message
  38. Inline that exception by name already tells much
  39. Inline I don't think you want to spout more than required polluting the vision of the user etc.
  40. enoq not sure if this is sarcasm or enlightenment
  41. Inline fail early, fail hard, fail loudly
  42. Inline hmmmm
  43. Inline there's no rule fail verbosely
  44. enoq at least my gutt feeling is that introducing custom exceptions makes sense if they could be caught
  45. Inline right
  46. Inline if it's domain specific anyway....
  47. Inline catch what you can
  48. Inline and handle it if you can, otherwise err as generic
  49. * five618480339176 joined #java
  50. Bombe Sometimes I do both: class RequiredValueMissing extends IllegateStateException {}.
  51. * henbruas joined #java
  52. * Tenchi joined #java
  53. * fstd joined #java
  54. * X-Scale joined #java
  55. * MonsterAbyss joined #java
  56. * MonsterAbyss joined #java
  57. * MikeBux joined #java
  58. deebo anyone aware of some sort of "remote data repository" for spring data repositories over spring-data-rest ? just to avoid writing the client as well
  59. * MonsterAbyss joined #java
  60. * Pixi` joined #java
  61. * MikeBux joined #java
  62. * fgarcia joined #java
  63. dreamreal ~gpt anyone know of a spring client library for REST semantics, sort of a "remote data repository"?
  64. * tazle joined #java
  65. javabot Yes, there is one such library called Spring RestTemplate. It's a synchronous HTTP client for making HTTP requests to consume RESTful web services. However, RestTemplate is in maintenance mode and the Spring team suggests using WebClient from the Spring WebFlux project for new projects. You can find more about WebClient here: https://docs.spring.io/spring-framework/docs/5.0.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/web/reactive/function/client/Web
  66. dreamreal DO NOT PAY ATTENTION TO THE LLM.
  67. dreamreal The 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.
  68. dreamreal You could get closer with graphql, but only for read semantics.
  69. Para jdbc-over-http sounds like something people used to do back in the IT bubble days
  70. dreamreal they didn't, though: it sounds like something that would have been tried, but getting connections over RMI was never allowed :D
  71. * kusanagi joined #java
  72. * fgarcia joined #java
  73. * lostlazy_ joined #java
  74. * Betal joined #java
  75. * tazle joined #java
  76. * PyR3X joined #java
  77. * nani joined #java
  78. * GreenResponse joined #java
  79. * pr3d4t0r joined #java
  80. * Ragnor joined #java
  81. jreicher enoq: 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?
  82. enoq jreicher, 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
  83. * MonsterAbyss joined #java
  84. jreicher Hmm. How are you loading the configs? If you're using a library of some kind it'll probably have exceptions already.
  85. * jamezp joined #java
  86. * sa02irc joined #java
  87. dreamreal Why not throw RuntimeException or a derivative of it
  88. enoq jreicher, no library; I know there things like Spring provide an easy way to map that onto POJOs but it's a very simple script
  89. enoq dreamreal, 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
  90. enoq could also through a generic RuntimeException("message here") I guess
  91. dreamreal I'd say build the custom exception, personally; if that's "ceremony" your metric for ceremony's set very oddly to me
  92. dreamreal inodes are CHEAP
  93. enoq thanks
  94. * tronexte joined #java
  95. * rvalue- joined #java
  96. * OmniRadix joined #java
  97. * Nav94 joined #java
  98. * Inline joined #java
  99. * kathadris joined #java
  100. * Inline left #java (No boundaries on the net!)
  101. * m joined #java
  102. * jreicher joined #java
  103. * X-Scale joined #java
  104. * AMcBain joined #java
  105. * Aedil3 joined #java
  106. * dob1 joined #java
  107. * MonsterAbyss joined #java
  108. * MikeBux joined #java
  109. * magla joined #java
  110. * hwpplayer1 joined #java
  111. * s3 joined #java
  112. jreicher enoq: 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.
  113. jreicher What 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.
  114. jreicher As I said, it feels like a coding style question.
  115. enoq thank you
  116. * sa02irc joined #java
  117. * Nav94 joined #java
  118. * fstd joined #java
  119. * tazle joined #java
  120. * MikeBux joined #java
  121. * tronexte joined #java
  122. * Betal joined #java
  123. * PyR3X joined #java
  124. * s3 joined #java
  125. * jamezp joined #java
  126. * BytesAndCoffee joined #java
  127. * hwpplayer1 joined #java
  128. * Inline joined #java
  129. * A_Dragon joined #java
  130. * qbone joined #java
  131. * X-Scale joined #java
  132. * jreicher joined #java
  133. * undermine joined #java
  134. * lostlazy_ joined #java
  135. * mindCrime joined #java
  136. * kinabalu joined #java
  137. * waz joined #java
  138. * marcel1 joined #java