Skip to content

Commit 6dd5f9e

Browse files
committed
fix(robotcode): catch OSError's if we can't create the default robot.toml config file
1 parent 570232d commit 6dd5f9e

File tree

1 file changed

+6
-2
lines changed
  • packages/robot/src/robotcode/robot/config

1 file changed

+6
-2
lines changed

packages/robot/src/robotcode/robot/config/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ def get_user_config_file(
2222

2323
if verbose_callback:
2424
verbose_callback(f"User configuration file not found, try to create it at:\n {result}")
25-
26-
get_default_config().save(result)
25+
try:
26+
get_default_config().save(result)
27+
except OSError as e:
28+
if verbose_callback:
29+
verbose_callback(f"Cannot create user configuration file `{result}`:\n {e}")
30+
return None
2731

2832
return result
2933

0 commit comments

Comments
 (0)