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
9d542932
Commit
9d542932
authored
Jul 13, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capture message text of exceptions if actors die
parent
8d359374
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
78 additions
and
8 deletions
+78
-8
CHANGELOG.md
CHANGELOG.md
+2
-0
cmake/caf-generate-enum-strings.cpp
cmake/caf-generate-enum-strings.cpp
+3
-0
libcaf_core/caf/exit_reason.hpp
libcaf_core/caf/exit_reason.hpp
+1
-1
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+2
-1
libcaf_core/src/blocking_actor.cpp
libcaf_core/src/blocking_actor.cpp
+3
-1
libcaf_core/src/exit_reason_strings.cpp
libcaf_core/src/exit_reason_strings.cpp
+6
-0
libcaf_core/src/intrusive/inbox_result_strings.cpp
libcaf_core/src/intrusive/inbox_result_strings.cpp
+6
-0
libcaf_core/src/intrusive/task_result_strings.cpp
libcaf_core/src/intrusive/task_result_strings.cpp
+6
-0
libcaf_core/src/invoke_msg_result_strings.cpp
libcaf_core/src/invoke_msg_result_strings.cpp
+6
-0
libcaf_core/src/message_priority_strings.cpp
libcaf_core/src/message_priority_strings.cpp
+6
-0
libcaf_core/src/pec_strings.cpp
libcaf_core/src/pec_strings.cpp
+6
-0
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+6
-4
libcaf_core/src/sec_strings.cpp
libcaf_core/src/sec_strings.cpp
+6
-0
libcaf_core/src/stream_priority_strings.cpp
libcaf_core/src/stream_priority_strings.cpp
+6
-0
libcaf_core/test/custom_exception_handler.cpp
libcaf_core/test/custom_exception_handler.cpp
+1
-1
libcaf_io/src/io/basp/message_type_strings.cpp
libcaf_io/src/io/basp/message_type_strings.cpp
+6
-0
libcaf_io/src/io/network/operation_strings.cpp
libcaf_io/src/io/network/operation_strings.cpp
+6
-0
No files found.
CHANGELOG.md
View file @
9d542932
...
...
@@ -54,6 +54,8 @@ is based on [Keep a Changelog](https://keepachangelog.com).
-
The
`to_string`
output for
`error`
now renders the error code enum by default.
This renders the member functions
`actor_system::render`
and
`actor_system_config::render`
obsolete.
-
Actors that die due to an unhandled exception now use
`sec::runtime_error`
consistently. This makes
`exit_reason::unhandled_exception`
obsolete.
### Changed
...
...
cmake/caf-generate-enum-strings.cpp
View file @
9d542932
...
...
@@ -104,6 +104,8 @@ int main(int argc, char** argv) {
<<
"// DO NOT EDIT: "
"this file is auto-generated by caf-generate-enum-strings.
\n
"
"// Run the target update-enum-strings if this file is out of sync.
\n
"
"#include
\"
caf/config.hpp
\"\n\n
"
"CAF_PUSH_DEPRECATED_WARNING
\n\n
"
<<
"#include
\"
"
<<
namespaces
[
0
];
for
(
size_t
i
=
1
;
i
<
namespaces
.
size
();
++
i
)
out
<<
'/'
<<
namespaces
[
i
];
...
...
@@ -142,4 +144,5 @@ int main(int argc, char** argv) {
<<
"}
\n\n
"
;
for
(
auto
i
=
namespaces
.
rbegin
();
i
!=
namespaces
.
rend
();
++
i
)
out
<<
"} // namespace "
<<
*
i
<<
'\n'
;
out
<<
"
\n
CAF_POP_WARNINGS
\n
"
;
}
libcaf_core/caf/exit_reason.hpp
View file @
9d542932
...
...
@@ -35,7 +35,7 @@ enum class exit_reason : uint8_t {
/// Indicates that an actor finished execution without error.
normal
=
0
,
/// Indicates that an actor died because of an unhandled exception.
unhandled_exception
,
unhandled_exception
[[
deprecated
(
"superseded by sec::runtime_error"
)]]
,
/// Indicates that the exit reason for this actor is unknown, i.e.,
/// the actor has been terminated and no longer exists.
unknown
,
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
9d542932
...
...
@@ -250,7 +250,8 @@ public:
static
void
default_exit_handler
(
pointer
ptr
,
exit_msg
&
x
);
#ifdef CAF_ENABLE_EXCEPTIONS
static
error
default_exception_handler
(
pointer
ptr
,
std
::
exception_ptr
&
x
);
static
error
default_exception_handler
(
local_actor
*
ptr
,
std
::
exception_ptr
&
x
);
#endif // CAF_ENABLE_EXCEPTIONS
// -- constructors and destructors -------------------------------------------
...
...
libcaf_core/src/blocking_actor.cpp
View file @
9d542932
...
...
@@ -28,6 +28,7 @@
#include "caf/detail/sync_request_bouncer.hpp"
#include "caf/invoke_message_result.hpp"
#include "caf/logger.hpp"
#include "caf/scheduled_actor.hpp"
#include "caf/telemetry/timer.hpp"
namespace
caf
{
...
...
@@ -121,7 +122,8 @@ void blocking_actor::launch(execution_unit*, bool, bool hide) {
self
->
act
();
rsn
=
self
->
fail_state_
;
}
catch
(...)
{
rsn
=
exit_reason
::
unhandled_exception
;
auto
ptr
=
std
::
current_exception
();
rsn
=
scheduled_actor
::
default_exception_handler
(
self
,
ptr
);
}
try
{
self
->
on_exit
();
...
...
libcaf_core/src/exit_reason_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/exit_reason.hpp"
#include <string>
...
...
@@ -31,3 +35,5 @@ std::string to_string(exit_reason x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/intrusive/inbox_result_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/intrusive/inbox_result.hpp"
#include <string>
...
...
@@ -23,3 +27,5 @@ std::string to_string(inbox_result x) {
}
// namespace intrusive
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/intrusive/task_result_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/intrusive/task_result.hpp"
#include <string>
...
...
@@ -25,3 +29,5 @@ std::string to_string(task_result x) {
}
// namespace intrusive
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/invoke_msg_result_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/invoke_message_result.hpp"
#include <string>
...
...
@@ -21,3 +25,5 @@ std::string to_string(invoke_message_result x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/message_priority_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/message_priority.hpp"
#include <string>
...
...
@@ -19,3 +23,5 @@ std::string to_string(message_priority x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/pec_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/pec.hpp"
#include <string>
...
...
@@ -61,3 +65,5 @@ std::string to_string(pec x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/scheduled_actor.cpp
View file @
9d542932
...
...
@@ -96,22 +96,24 @@ void scheduled_actor::default_exit_handler(scheduled_actor* ptr, exit_msg& x) {
}
#ifdef CAF_ENABLE_EXCEPTIONS
error
scheduled_actor
::
default_exception_handler
(
pointer
ptr
,
error
scheduled_actor
::
default_exception_handler
(
local_actor
*
ptr
,
std
::
exception_ptr
&
x
)
{
CAF_ASSERT
(
x
!=
nullptr
);
try
{
std
::
rethrow_exception
(
x
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
std
::
exception
&
e
)
{
auto
pretty_type
=
detail
::
pretty_type_name
(
typeid
(
e
));
aout
(
ptr
)
<<
"*** unhandled exception: [id: "
<<
ptr
->
id
()
<<
", name: "
<<
ptr
->
name
()
<<
", exception typeid: "
<<
typeid
(
e
).
name
()
<<
"]: "
<<
e
.
what
()
<<
", exception typeid: "
<<
pretty_type
<<
"]: "
<<
e
.
what
()
<<
std
::
endl
;
return
make_error
(
sec
::
runtime_error
,
std
::
move
(
pretty_type
),
e
.
what
());
}
catch
(...)
{
aout
(
ptr
)
<<
"*** unhandled exception: [id: "
<<
ptr
->
id
()
<<
", name: "
<<
ptr
->
name
()
<<
"]: unknown exception"
<<
std
::
endl
;
return
sec
::
runtime_error
;
}
return
sec
::
runtime_error
;
}
#endif // CAF_ENABLE_EXCEPTIONS
...
...
libcaf_core/src/sec_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/sec.hpp"
#include <string>
...
...
@@ -125,3 +129,5 @@ std::string to_string(sec x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/src/stream_priority_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/stream_priority.hpp"
#include <string>
...
...
@@ -25,3 +29,5 @@ std::string to_string(stream_priority x) {
}
}
// namespace caf
CAF_POP_WARNINGS
libcaf_core/test/custom_exception_handler.cpp
View file @
9d542932
...
...
@@ -63,7 +63,7 @@ CAF_TEST(test_custom_exception_handler) {
catch
(...)
{
// "fall through"
}
return
exit_reason
::
unhandled_exception
;
return
sec
::
runtime_error
;
};
scoped_actor
self
{
system
};
auto
testee1
=
self
->
spawn
<
monitored
>
([
=
](
event_based_actor
*
eb_self
)
{
...
...
libcaf_io/src/io/basp/message_type_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/io/basp/message_type.hpp"
#include <string>
...
...
@@ -33,3 +37,5 @@ std::string to_string(message_type x) {
}
// namespace basp
}
// namespace io
}
// namespace caf
CAF_POP_WARNINGS
libcaf_io/src/io/network/operation_strings.cpp
View file @
9d542932
// clang-format off
// DO NOT EDIT: this file is auto-generated by caf-generate-enum-strings.
// Run the target update-enum-strings if this file is out of sync.
#include "caf/config.hpp"
CAF_PUSH_DEPRECATED_WARNING
#include "caf/io/network/operation.hpp"
#include <string>
...
...
@@ -25,3 +29,5 @@ std::string to_string(operation x) {
}
// namespace network
}
// namespace io
}
// namespace caf
CAF_POP_WARNINGS
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