If there is a topic that's still not entirely clea...
# ksp
e
If there is a topic that's still not entirely clear to me, is how errors should be reported. Let's say that my processor encounters a symbol that it cannot process for whatever reason: should I throw a specific exception, use
KSLogger.error
while returning an empty list, or should I prefer a "never error out" approach?
t
KSPLogger.error
and make sure you provide it with the
symbol: KSNode
it was looking at when it failed so the info reported back to the user points it to where the issue spawns from. At least that is how I always do it
e
Thanks! It seems like I always end up with a lot of repetitive
Copy code
if (...) {
  logger.error("...", symbol)
  return emptyList()
}
which is not a big issue, it's just... not the best code.
t
oh yeah thats right looking to me. only time you wouldn't do the empty list is if you want to try to process the symbol in a follow up round. I want to say thats only going to apply if some other processor needs to generate something before you can correctly do your part
and you would probably warn/info instead of error if you are going to defer the symbol