# File lib/pry/commands/edit/file_and_line_locator.rb, line 17
        def from_exception(exception, backtrace_level)
          raise CommandError, "No exception found." if exception.nil?

          file_name, line = exception.bt_source_location_for(backtrace_level)
          raise CommandError, "Exception has no associated file." if file_name.nil?
          raise CommandError, "Cannot edit exceptions raised in REPL." if Pry.eval_path == file_name

          [file_name, line]
        end