Trap all possible exceptions.
Add imports.