Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
4ef88751
Commit
4ef88751
authored
6 years ago
by
Ge Jun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch std::string and const char* for thrift callback which may throws the stuffs as well
parent
cf9e2f71
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
thrift_protocol.cpp
src/brpc/policy/thrift_protocol.cpp
+5
-1
No files found.
src/brpc/policy/thrift_protocol.cpp
View file @
4ef88751
...
...
@@ -393,8 +393,12 @@ inline void ProcessThriftFramedRequestNoExcept(ThriftService* service,
// we can still set `cntl' in the catch branch.
try
{
service
->
ProcessThriftFramedRequest
(
cntl
,
req
,
res
,
done
);
}
catch
(
::
apache
::
thrift
::
TE
xception
&
e
)
{
}
catch
(
std
::
e
xception
&
e
)
{
cntl
->
SetFailed
(
EINTERNAL
,
"Catched exception: %s"
,
e
.
what
());
}
catch
(
std
::
string
&
e
)
{
cntl
->
SetFailed
(
EINTERNAL
,
"Catched std::string: %s"
,
e
.
c_str
());
}
catch
(
const
char
*
e
)
{
cntl
->
SetFailed
(
EINTERNAL
,
"Catched const char*: %s"
,
e
);
}
catch
(...)
{
cntl
->
SetFailed
(
EINTERNAL
,
"Catched unknown exception"
);
}
...
...
This diff is collapsed.
Click to expand it.
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