Why `kotlin.io.AccessDeniedException` isn’t a alia...
# getting-started
j
Why
kotlin.io.AccessDeniedException
isn’t a alias of
java.nio.AccessDeniedException
on JVM? Why creating such a new class that might confused the user that tries to catch this exception?
n
hm, what's it thrown by?
only reason I can think of is multiplatform
j
I’m calling Java’s file IO (AFAIK kotlin has no own file IO except some extension methods of Java’s type), which throws
java.nio.AccessDeniedException
. I wrongly catch
kotlin.io.AccessDeniedException
and realizes it doesn’t work and it’s not an alias (as other kotlin standard types are). Not a big deal but it’s confusing.
As I did more research I found
kotlin.io.AccessDeniedException
seems to be not used in Kotlin standard library so I’m quite confused about its existence only used in
FileTreeWalk
.
n
FileTreeWalk
uses it
but yeah I can see how that'd be confusing