Skip to content

Commit a75e17a

Browse files
committed
Updating error texts
1 parent a818d80 commit a75e17a

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

fcloud/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ def read_config(available_clouds: list[str], path: Optional[Path] = None) -> Con
4545
echo_error((title, message.format(cloud)))
4646

4747
# cfl_extension
48-
cfl_extension = get_config_data("FCLOUD", "cfl_extension", config=config)
49-
48+
cfl_extension = get_config_data(
49+
"FCLOUD", "cfl_extension", error=ConfigError.cfl_extension_error, config=config
50+
)
5051
# main_folder
5152
main_folder = Path(
5253
get_config_data(

fcloud/exceptions/config_errors.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from textwrap import dedent
23

34
from .file_errors import FileError
@@ -6,17 +7,26 @@
67
class ConfigError(FileError):
78
service_error = (
89
"Config error",
9-
"Can`t parse 'service' from '.conf'. Look at '.conf.example'",
10+
dedent(f"""\
11+
Can`t parse 'service' from '{os.environ.get('FCLOUD_CONFIG_PATH')}'. Most likely your configuration file
12+
is corrupted. You can reinstall fcloud or manually replace the configuration file with
13+
this one: https://github.com/theakopov/fcloud/blob/main/fcloud/.conf.'"""),
1014
)
1115

1216
main_folder_error = (
1317
"Main folder error",
14-
"Cant`t parse 'main_folder' from '.conf'. Look at '.conf.example'",
18+
dedent(f"""\
19+
Can`t parse 'main_folder' from '{os.environ.get('FCLOUD_CONFIG_PATH')}'. Most likely your configuration file
20+
is corrupted. You can reinstall fcloud or manually replace the configuration file with
21+
this one: https://github.com/theakopov/fcloud/blob/main/fcloud/.conf.'"""),
1522
)
1623

1724
cfl_extension_error = (
1825
"CFL extension error",
19-
"Cant`t parse 'cfl_extension' from '.conf'. Look at '.conf.example'",
26+
dedent(f"""\
27+
Can`t parse 'cfl_extension' from '{os.environ.get('FCLOUD_CONFIG_PATH')}'. Most likely your configuration file
28+
is corrupted. You can reinstall fcloud or manually replace the configuration file with
29+
this one: https://github.com/theakopov/fcloud/blob/main/fcloud/.conf.'"""),
2030
)
2131

2232
section_error = (

0 commit comments

Comments
 (0)