Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
9eac2a34
Commit
9eac2a34
authored
May 07, 2015
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For unimplemented methods, return the exception (turning it into a promise) rather than throw.
parent
b32a53bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
20 deletions
+5
-20
capability.c++
c++/src/capnp/capability.c++
+5
-20
No files found.
c++/src/capnp/capability.c++
View file @
9eac2a34
...
...
@@ -80,34 +80,19 @@ Capability::Client::Client(kj::Exception&& exception)
kj
::
Promise
<
void
>
Capability
::
Server
::
internalUnimplemented
(
const
char
*
actualInterfaceName
,
uint64_t
requestedTypeId
)
{
KJ_UNIMPLEMENTED
(
"Requested interface not implemented."
,
actualInterfaceName
,
requestedTypeId
)
{
// Recoverable exception will be caught by promise framework.
// We can't "return kj::READY_NOW;" inside this block because it causes a memory leak due to
// a bug that exists in both Clang and GCC:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33799
// http://llvm.org/bugs/show_bug.cgi?id=12286
break
;
}
return
kj
::
READY_NOW
;
return
KJ_EXCEPTION
(
UNIMPLEMENTED
,
"Requested interface not implemented."
,
actualInterfaceName
,
requestedTypeId
);
}
kj
::
Promise
<
void
>
Capability
::
Server
::
internalUnimplemented
(
const
char
*
interfaceName
,
uint64_t
typeId
,
uint16_t
methodId
)
{
KJ_UNIMPLEMENTED
(
"Method not implemented."
,
interfaceName
,
typeId
,
methodId
)
{
// Recoverable exception will be caught by promise framework.
break
;
}
return
kj
::
READY_NOW
;
return
KJ_EXCEPTION
(
UNIMPLEMENTED
,
"Method not implemented."
,
interfaceName
,
typeId
,
methodId
);
}
kj
::
Promise
<
void
>
Capability
::
Server
::
internalUnimplemented
(
const
char
*
interfaceName
,
const
char
*
methodName
,
uint64_t
typeId
,
uint16_t
methodId
)
{
KJ_UNIMPLEMENTED
(
"Method not implemented."
,
interfaceName
,
typeId
,
methodName
,
methodId
)
{
// Recoverable exception will be caught by promise framework.
break
;
}
return
kj
::
READY_NOW
;
return
KJ_EXCEPTION
(
UNIMPLEMENTED
,
"Method not implemented."
,
interfaceName
,
typeId
,
methodName
,
methodId
);
}
ResponseHook
::~
ResponseHook
()
noexcept
(
false
)
{}
...
...
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