Use getLineNumber which already has exception handling.