Fix 'Unused Variable' warning
Improve exception handling by pretty printing it