|
134 | 134 | for mcu in options.mcu:
|
135 | 135 | # Program Number or name
|
136 | 136 | p, src, ide = options.program, options.source_dir, options.ide
|
137 |
| - project_dir, project_name, project_temp = setup_project(mcu, ide, p, src, options.build) |
138 |
| - |
139 |
| - zip = not bool(src) # create zip when no src_dir provided |
140 |
| - clean = not bool(src) # don't clean when source is provided, use acrual source tree for IDE files |
141 |
| - |
142 |
| - # Export to selected toolchain |
143 |
| - lib_symbols = get_lib_symbols(options.macros, src, p) |
144 |
| - tmp_path, report = export(project_dir, project_name, ide, mcu, project_dir[0], project_temp, clean=clean, make_zip=zip, extra_symbols=lib_symbols, sources_relative=sources_relative) |
| 137 | + try: |
| 138 | + project_dir, project_name, project_temp = setup_project(mcu, ide, p, src, options.build) |
| 139 | + zip = not bool(src) # create zip when no src_dir provided |
| 140 | + clean = not bool(src) # don't clean when source is provided, use acrual source tree for IDE files |
| 141 | + |
| 142 | + # Export to selected toolchain |
| 143 | + lib_symbols = get_lib_symbols(options.macros, src, p) |
| 144 | + tmp_path, report = export(project_dir, project_name, ide, mcu, project_dir[0], project_temp, clean=clean, make_zip=zip, extra_symbols=lib_symbols, sources_relative=sources_relative) |
| 145 | + except OSError as e: |
| 146 | + if e.errno == 2: |
| 147 | + report = dict(success=False, errormsg="Library path '%s' does not exist. Ensure that the library is built." % (e.filename)) |
| 148 | + else: |
| 149 | + report = dict(success=False, errormsg="An OS error occured: errno #{}".format(e.errno)) |
145 | 150 | if report['success']:
|
146 | 151 | if not zip:
|
147 | 152 | zip_path = join(project_temp, project_name)
|
|
0 commit comments