Skip to content

Commit

Permalink
[unity][unreal]websocket的错误信息加上error code
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 27, 2024
1 parent 63aca75 commit cca7bcb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions unreal/Puerts/Source/JsEnv/Private/WebSocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void V8WebSocketClientImpl::Connect(const v8::FunctionCallbackInfo<v8::Value>& I
if (ec)
{
std::stringstream ss;
ss << "could not create connection because: " << ec.message() << std::endl;
ss << "could not create connection because: " << ec.message() << "[" << ec.value() << "]" << std::endl;
FV8Utils::ThrowException(Isolate, ss.str().c_str());
return;
}
Expand Down Expand Up @@ -244,7 +244,7 @@ void V8WebSocketClientImpl::Send(const v8::FunctionCallbackInfo<v8::Value>& Info
if (ec)
{
std::stringstream ss;
ss << "could not create connection because: " << ec.message() << std::endl;
ss << "could send because: " << ec.message() << "[" << ec.value() << "]" << std::endl;
FV8Utils::ThrowException(Isolate, ss.str().c_str());
}
}
Expand Down Expand Up @@ -301,7 +301,9 @@ void V8WebSocketClientImpl::Close(const v8::FunctionCallbackInfo<v8::Value>& Inf
Client.close(Handle, code, reason, ec);
if (ec)
{
FV8Utils::ThrowException(Isolate, ec.message().c_str());
std::stringstream ss;
ss << "close fail: " << ec.message() << "[" << ec.value() << "]" << std::endl;
FV8Utils::ThrowException(Isolate, ss.str().c_str());
}
}
Cleanup();
Expand Down

0 comments on commit cca7bcb

Please sign in to comment.