# Failing to catch exceptions from smart card reader

**URL:** <https://forum.inductiveautomation.com/t/failing-to-catch-exceptions-from-smart-card-reader/19819>\
**Category:** Ignition\
**Created:** [September 25, 2018, 7:03pm UTC](https://forum.inductiveautomation.com/t/failing-to-catch-exceptions-from-smart-card-reader/19819 "2018-09-25T19:03:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 25, 2018, 7:56pm UTC](https://forum.inductiveautomation.com/t/failing-to-catch-exceptions-from-smart-card-reader/19819/6 "2018-09-25T19:56:56Z")

</div>

Set up two clauses, like so:

```auto
# Important! Do not use "from java.lang import Exception", as that will
# hide access to jython's Exception class.
import java.lang.Exception

def something():
	try:
		# do something
		pass
	except java.lang.Exception, e:
		# Handle java exceptions
		# follow e.cause, e.cause.cause, .... to examine nested exceptions
		pass
	except Exception, e:
		# Handle jython exceptions
		pass

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/failing-to-catch-exceptions-from-smart-card-reader/19819)._
