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
264d14b6
Unverified
Commit
264d14b6
authored
Jan 18, 2020
by
Dominik Charousset
Committed by
GitHub
Jan 18, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1021
Improve to_string output for caf::error
parents
55be26f8
333c5256
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+6
-2
libcaf_core/src/error.cpp
libcaf_core/src/error.cpp
+2
-4
No files found.
libcaf_core/src/actor_system_config.cpp
View file @
264d14b6
...
@@ -402,7 +402,8 @@ timespan actor_system_config::stream_tick_duration() const noexcept {
...
@@ -402,7 +402,8 @@ timespan actor_system_config::stream_tick_duration() const noexcept {
return
timespan
{
ns_count
};
return
timespan
{
ns_count
};
}
}
std
::
string
actor_system_config
::
render
(
const
error
&
err
)
{
std
::
string
actor_system_config
::
render
(
const
error
&
err
)
{
std
::
string
msg
;
if
(
!
err
)
return
"none"
;
switch
(
static_cast
<
uint64_t
>
(
err
.
category
()))
{
switch
(
static_cast
<
uint64_t
>
(
err
.
category
()))
{
case
atom_uint
(
"system"
):
case
atom_uint
(
"system"
):
return
render_sec
(
err
.
code
(),
err
.
category
(),
err
.
context
());
return
render_sec
(
err
.
code
(),
err
.
category
(),
err
.
context
());
...
@@ -410,8 +411,11 @@ std::string actor_system_config::render(const error& err) {
...
@@ -410,8 +411,11 @@ std::string actor_system_config::render(const error& err) {
return
render_exit_reason
(
err
.
code
(),
err
.
category
(),
err
.
context
());
return
render_exit_reason
(
err
.
code
(),
err
.
category
(),
err
.
context
());
case
atom_uint
(
"parser"
):
case
atom_uint
(
"parser"
):
return
render_pec
(
err
.
code
(),
err
.
category
(),
err
.
context
());
return
render_pec
(
err
.
code
(),
err
.
category
(),
err
.
context
());
default:
return
deep_to_string
(
meta
::
type_name
(
"error"
),
err
.
code
(),
err
.
category
(),
meta
::
omittable_if_empty
(),
err
.
context
());
}
}
return
"unknown-error"
;
}
}
std
::
string
std
::
string
...
...
libcaf_core/src/error.cpp
View file @
264d14b6
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include "caf/error.hpp"
#include "caf/error.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/config.hpp"
#include "caf/config.hpp"
#include "caf/deep_to_string.hpp"
#include "caf/deep_to_string.hpp"
#include "caf/deserializer.hpp"
#include "caf/deserializer.hpp"
...
@@ -169,10 +170,7 @@ void error::init() {
...
@@ -169,10 +170,7 @@ void error::init() {
}
}
std
::
string
to_string
(
const
error
&
x
)
{
std
::
string
to_string
(
const
error
&
x
)
{
if
(
!
x
)
return
actor_system_config
::
render
(
x
);
return
"none"
;
return
deep_to_string
(
meta
::
type_name
(
"error"
),
x
.
code
(),
x
.
category
(),
meta
::
omittable_if_empty
(),
x
.
context
());
}
}
}
// namespace caf
}
// namespace caf
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