added broader exception check
method comment formatting