Chat Logs

  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. jreicherjavabot: welcome back
  19. javabotjreicher, what does that even *mean*?
  20. jreicherOnly that I missed you. Never mind.
  21. jreicherHeh. 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. 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?
  32. enoqthere's nothing to recover from really
  33. Inlineyah, let the user know the state is not ok
  34. Inlinenot because of something wrong but rather something missing/absent
  35. enoqso no RequiredConfigValueMissingException
  36. Inlineyah
  37. enoqI mean you can always explain the issue in the message
  38. Inlinethat exception by name already tells much
  39. InlineI don't think you want to spout more than required polluting the vision of the user etc.
  40. enoqnot sure if this is sarcasm or enlightenment
  41. Inlinefail early, fail hard, fail loudly
  42. Inlinehmmmm
  43. Inlinethere's no rule fail verbosely
  44. enoqat least my gutt feeling is that introducing custom exceptions makes sense if they could be caught
  45. Inlineright
  46. Inlineif it's domain specific anyway....
  47. Inlinecatch what you can
  48. Inlineand handle it if you can, otherwise err as generic
  49. * five618480339176 joined #java
  50. BombeSometimes 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. 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
  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. javabotYes, 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. dreamrealDO NOT PAY ATTENTION TO THE LLM.
  67. 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.
  68. dreamrealYou could get closer with graphql, but only for read semantics.
  69. Parajdbc-over-http sounds like something people used to do back in the IT bubble days
  70. dreamrealthey 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. 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?
  82. 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
  83. * MonsterAbyss joined #java
  84. jreicherHmm. 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. dreamrealWhy not throw RuntimeException or a derivative of it
  88. 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
  89. 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
  90. enoqcould also through a generic RuntimeException("message here") I guess
  91. dreamrealI'd say build the custom exception, personally; if that's "ceremony" your metric for ceremony's set very oddly to me
  92. dreamrealinodes are CHEAP
  93. enoqthanks
  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. 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.
  113. 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.
  114. jreicherAs I said, it feels like a coding style question.
  115. enoqthank 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