Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
6372c643
Commit
6372c643
authored
Nov 06, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise error when opening user-defined config fails
parent
1b1aae99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+7
-1
No files found.
libcaf_core/src/actor_system_config.cpp
View file @
6372c643
...
@@ -342,9 +342,14 @@ void print(const config_value::dictionary& xs, indentation indent) {
...
@@ -342,9 +342,14 @@ void print(const config_value::dictionary& xs, indentation indent) {
error
actor_system_config
::
parse
(
string_list
args
,
std
::
istream
&
ini
)
{
error
actor_system_config
::
parse
(
string_list
args
,
std
::
istream
&
ini
)
{
// Content of the INI file overrides hard-coded defaults.
// Content of the INI file overrides hard-coded defaults.
if
(
ini
.
good
())
if
(
ini
.
good
())
{
if
(
auto
err
=
parse_config
(
ini
,
custom_options_
,
content
))
if
(
auto
err
=
parse_config
(
ini
,
custom_options_
,
content
))
return
err
;
return
err
;
}
else
{
// Not finding an explicitly defined config file is an error.
if
(
auto
fname
=
get_if
<
std
::
string
>
(
&
content
,
"config-file"
))
return
make_error
(
sec
::
cannot_open_file
,
*
fname
);
}
// CLI options override the content of the INI file.
// CLI options override the content of the INI file.
using
std
::
make_move_iterator
;
using
std
::
make_move_iterator
;
auto
res
=
custom_options_
.
parse
(
content
,
args
);
auto
res
=
custom_options_
.
parse
(
content
,
args
);
...
@@ -516,6 +521,7 @@ error actor_system_config::extract_config_file_path(string_list& args) {
...
@@ -516,6 +521,7 @@ error actor_system_config::extract_config_file_path(string_list& args) {
auto
evalue
=
ptr
->
parse
(
path
);
auto
evalue
=
ptr
->
parse
(
path
);
if
(
!
evalue
)
if
(
!
evalue
)
return
std
::
move
(
evalue
.
error
());
return
std
::
move
(
evalue
.
error
());
put
(
content
,
"config-file"
,
*
evalue
);
ptr
->
store
(
*
evalue
);
ptr
->
store
(
*
evalue
);
return
none
;
return
none
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment