提交 702718aa 编写于 作者: I igerasim

6474807: (smartcardio) CardTerminal.connect() throws CardException instead of...

6474807: (smartcardio) CardTerminal.connect() throws CardException instead of CardNotPresentException
Reviewed-by: valeriep
上级 e5103f25
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -78,7 +78,7 @@ final class TerminalImpl extends CardTerminal { ...@@ -78,7 +78,7 @@ final class TerminalImpl extends CardTerminal {
card = new CardImpl(this, protocol); card = new CardImpl(this, protocol);
return card; return card;
} catch (PCSCException e) { } catch (PCSCException e) {
if (e.code == SCARD_W_REMOVED_CARD) { if (e.code == SCARD_W_REMOVED_CARD || e.code == SCARD_E_NO_SMARTCARD) {
throw new CardNotPresentException("No card present", e); throw new CardNotPresentException("No card present", e);
} else { } else {
throw new CardException("connect() failed", e); throw new CardException("connect() failed", e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册