File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ class ErrorInfoBase {
127
127
// /
128
128
// / auto E = foo(<...>); // <- foo returns failure with MyErrorInfo.
129
129
// / auto NewE =
130
- // / handleErrors(E ,
130
+ // / handleErrors(std::move(E) ,
131
131
// / [](const MyErrorInfo &M) {
132
132
// / // Deal with the error.
133
133
// / },
@@ -138,9 +138,15 @@ class ErrorInfoBase {
138
138
// / }
139
139
// / // Couldn't handle this error instance. Pass it up the stack.
140
140
// / return Error(std::move(M));
141
- // / );
142
- // / // Note - we must check or return NewE in case any of the handlers
143
- // / // returned a new error.
141
+ // / });
142
+ // / // Note - The error passed to handleErrors will be marked as checked. If
143
+ // / // there is no matched handler, a new error with the same payload is
144
+ // / // created and returned.
145
+ // / // The handlers take the error checked by handleErrors as an argument,
146
+ // / // which can be used to retrieve more information. If a new error is
147
+ // / // created by a handler, it will be passed back to the caller of
148
+ // / // handleErrors and needs to be checked or return up to the stack.
149
+ // / // Otherwise, the passed-in error is considered consumed.
144
150
// / @endcode
145
151
// /
146
152
// / The handleAllErrors function is identical to handleErrors, except
You can’t perform that action at this time.
0 commit comments