Added error logging for exceptions

Add EOL while you're at it. ;)