Handle errors when opening files

Issue #33 new
Juan Pablo Caram repo owner created an issue

Parsing errors when opening the wrong file type and similar.

Comments (2)

  1. Juan Pablo Caram reporter

    Example: Attempt to open the .dri file generated by Eagle. It is not an Excellon file so it should fail:

    [ERROR] could not convert string to float: 
    [ERROR] could not convert string to float: 
    [ERROR] <traceback object at 0x4515878>
    [ERROR] <traceback object at 0x4515878>
    Traceback (most recent call last):
      File "/home/jpcaram/flatcam/FlatCAMWorker.py", line 32, in do_worker_task
        task['fcn'](*task['params'])
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1648, in open_excellon
        self.new_object("excellon", name, obj_init)
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 778, in new_object
        initialize(obj, self)
      File "/home/jpcaram/flatcam/FlatCAMApp.py", line 1628, in obj_init
        excellon_obj.parse_file(filename)
      File "/home/jpcaram/flatcam/camlib.py", line 2184, in parse_file
        self.parse_lines(estr)
      File "/home/jpcaram/flatcam/camlib.py", line 2251, in parse_lines
        x = self.parse_number(match.group(1))
      File "/home/jpcaram/flatcam/camlib.py", line 2364, in parse_number
        return float(number_str) / 10000
    ValueError: could not convert string to float:
    
  2. Juan Pablo Caram reporter

    I just tried opening a .py as a Gerber. The object was created without errors. Errors were thrown (shown in the terminal) when trying to plot though. Nothing interesting in the GUI whatsoever. Will implement only some very simple checks and handlers for 8.5 and this issue will remain open.

  3. Log in to comment