Does anyone know, do I need to wrap the logic insi...
# server
h
Does anyone know, do I need to wrap the logic inside my
handleRequest
function into a
try catch
block in here? https://gist.github.com/rinnegan/3f65805a2f510519e738c4365b6fe97c#file-do-i-need-to-wrap-logic-in-try-catch-block-L20 I am confused because
processor.process(input, output)
will throw a checked exception in Java but Kotlin as no checked exceptions so I'm not sure what to do
n
as you wrote, kotlin has no checked exception but in java, checked exceptions are only compile time there’s no such thing as checked exceptions in the bytecode since you compile with kotlin, you don’t need to try/catch
h
@nfrankel thanks but what if an exception is thrown? Do I need to explicitly handle it in this case or just let it occur silently?
g
Up yo you, what is better for your particular use case, handle this error or not
n
just as with java runtime exception it’s up to you to handle it or to let it bubble up the stack
h
Okay thanks