Skip to content

Instantly share code, notes, and snippets.

Last active October 24, 2021 08:18
What would you like to do?
throwing exception
fun findEmployeeByName(name: String): Employee {
val request = Request(Method.GET, "").query("name", name)
val response: Response = client(request)
if (response.status == Status.OK) {
return Employee(response.bodyString())
throw RuntimeException("Could not find employee $name!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment