mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-23 08:21:22 +00:00
Adding suggested exception from @PauloMigAlmeida
When the OTP code is requested, then the special GHOTPRequiredException is raised instead of the generic IOException. This differentiates between an OTP request and a failed password.
This commit is contained in:
@@ -33,7 +33,7 @@ public class Github2faTest extends AbstractGitHubWireMockTest {
|
||||
GHAuthorization token=null;
|
||||
try {
|
||||
token = gitHub.createToken(asList, nameOfToken, "this is a test token created by a unit test");
|
||||
}catch (IOException ex) {
|
||||
}catch (GHOTPRequiredException ex) {
|
||||
//ex.printStackTrace();
|
||||
// under 2fa mode this exception is expected, and is necessary
|
||||
// as the exception is called, GitHub will generate and send an OTP to the users SMS
|
||||
|
||||
Reference in New Issue
Block a user