Fix warning, use endl, catch style

Fix unreferenced variable warning, use std::endl instead of newline
in log messages, place 'catch' clause on separate line.