Return ALREADY_EXISTS instead of UNAVAILABLE error when profiling is already active
Makes C++ code consistent with python APIs. PiperOrigin-RevId: 360493350 Change-Id: I37f3400dcd7fc2a9841b7e8d313a3ae7911bac00
This commit is contained in:
parent
b2cd7ad7d2
commit
f07914d9d7
@ -118,7 +118,7 @@ ProfilerSession::ProfilerSession(ProfileOptions options)
|
||||
options_(std::move(options)) {
|
||||
#if !defined(IS_MOBILE_PLATFORM)
|
||||
if (!active_) {
|
||||
status_ = tensorflow::Status(error::UNAVAILABLE,
|
||||
status_ = tensorflow::Status(error::ALREADY_EXISTS,
|
||||
"Another profiler session is active.");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user