Skip to content

Commit 17c97c8

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
Log when a Result is created from Error::ok
Summary: If this ctor is firing something has probably gone wrong. I found it a little hard to debug so adding logging to hopefully save someone else time in the future. Differential Revision: D69870978
1 parent 00c1443 commit 17c97c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runtime/core/result.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ class Result final {
6060
*/
6161
/* implicit */ Result(Error error)
6262
: error_(error == Error::Ok ? Error::Internal : error),
63-
hasValue_(false) {}
63+
hasValue_(false) {
64+
ET_LOG(
65+
Info,
66+
"Attempted to create Result from Error::OK, \
67+
this has been converted to Error::Internal.");
68+
}
6469

6570
/// Value copy constructor.
6671
/* implicit */ Result(const T& val) : value_(val), hasValue_(true) {}

0 commit comments

Comments
 (0)