Skip to content

Commit 268b6e7

Browse files
Bug, AsyncReadWriteTask::RunTask、AsyncConnectTask::RunTask缺乏返回值
1 parent bcdd786 commit 268b6e7

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

include/YY/Base/IO/File.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ namespace YY
5050

5151
HRESULT __YYAPI RunTask() override
5252
{
53-
pfnResultCallback(lStatus, uint32_t(InternalHigh));
53+
try
54+
{
55+
pfnResultCallback(lStatus, uint32_t(InternalHigh));
56+
}
57+
catch (const YY::OperationCanceledException&)
58+
{
59+
return YY::HRESULT_From_LSTATUS(ERROR_CANCELLED);
60+
}
61+
62+
return S_OK;
5463
}
5564
};
5665

@@ -485,7 +494,16 @@ namespace YY
485494

486495
HRESULT __YYAPI RunTask() override
487496
{
488-
pfnResultCallback(lStatus);
497+
try
498+
{
499+
pfnResultCallback(lStatus);
500+
}
501+
catch (const YY::OperationCanceledException&)
502+
{
503+
return YY::HRESULT_From_LSTATUS(ERROR_CANCELLED);
504+
}
505+
506+
return S_OK;
489507
}
490508
};
491509

0 commit comments

Comments
 (0)