JetBrains / space-kotlin-sdk

Kotlin client for JetBrains Space HTTP API
Apache License 2.0
46 stars 3 forks source link

Include common exceptions in documentation and docstrings #5

Open SebastianAigner opened 1 year ago

SebastianAigner commented 1 year ago

Without some kind of hint in the docs, it's very hard to discern what will happen in cases like calling teamDirectory.profiles.getProfile(ProfileIdentifier.Username(spaceUsername)) where no profile with spaceUsername exists.

This function, for example, throws a space.jetbrains.api.runtime.NotFoundException, but this isn't mentioned in its docstring, and some brief navigation through its implementation also does not reveal further information on the fact that this exception (which I imagine is quite common) is being thrown.

It would be nice to mention such common exceptions in the respective docstrings. Or, of course, move to some kind of Result-type based API altogether 😉