Skip to content

Commit 82b8409

Browse files
committed
Improve error message when board doesn't exist
1 parent 0f63d99 commit 82b8409

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kikit/panelize_ui.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def doPanelization(input, output, preset, plugins=[]):
237237
handle errors based on the context; e.g., CLI vs GUI
238238
"""
239239
from kikit import panelize_ui_impl as ki
240-
from kikit.panelize import Panel, NonFatalErrors
240+
from kikit.panelize import Panel, NonFatalErrors, PanelError
241241
from pcbnewTransition.transition import pcbnew
242242
from pcbnewTransition.pcbnew import LoadBoard
243243
from itertools import chain
@@ -249,6 +249,8 @@ def doPanelization(input, output, preset, plugins=[]):
249249
kikit.substrate.TABFAIL_VISUAL = True
250250

251251
board = LoadBoard(input)
252+
if board is None:
253+
raise PanelError(f"Cannot load board {input}. Check if the path is correct or if you have permissions to read it.")
252254
panel = Panel(output)
253255

254256
useHookPlugins = ki.loadHookPlugins(plugins, board, preset)

0 commit comments

Comments
 (0)