Add missing import and exception print.