Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Проброс ошибки #3

Open
alex-grandson opened this issue Dec 30, 2022 · 0 comments
Open

Проброс ошибки #3

alex-grandson opened this issue Dec 30, 2022 · 0 comments

Comments

@alex-grandson
Copy link

if (name.isNullOrBlank() || password.isNullOrBlank()) throw RuntimeException()
AuthService.addCredential(name, password)
call.respondText("Auth successful", status = HttpStatusCode.OK)
} catch (throwable: Throwable) {
throwable.printStackTrace()
call.respond(HttpStatusCode.BadRequest)
}

Плохая практика так пробрасывать, обернуть 20-21 в блок кода, ниже продублировать 24, с пробросом дальше и это может быть штатная ситуация.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant