mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
map the response of the ws.send
call into a LuaError
This commit is contained in:
parent
4ed7cafc77
commit
e5a844ecec
1 changed files with 14 additions and 14 deletions
|
@ -154,8 +154,7 @@ where
|
||||||
{
|
{
|
||||||
let mut ws = socket.write_stream.lock().await;
|
let mut ws = socket.write_stream.lock().await;
|
||||||
|
|
||||||
let _ = ws
|
ws.send(WsMessage::Close(Some(WsCloseFrame {
|
||||||
.send(WsMessage::Close(Some(WsCloseFrame {
|
|
||||||
code: match code {
|
code: match code {
|
||||||
Some(code) if (1000..=4999).contains(&code) => WsCloseCode::from(code),
|
Some(code) if (1000..=4999).contains(&code) => WsCloseCode::from(code),
|
||||||
Some(code) => {
|
Some(code) => {
|
||||||
|
@ -167,7 +166,8 @@ where
|
||||||
},
|
},
|
||||||
reason: "".into(),
|
reason: "".into(),
|
||||||
})))
|
})))
|
||||||
.await;
|
.await
|
||||||
|
.map_err(LuaError::external)?;
|
||||||
|
|
||||||
let res = ws.close();
|
let res = ws.close();
|
||||||
res.await.map_err(LuaError::external)
|
res.await.map_err(LuaError::external)
|
||||||
|
|
Loading…
Add table
Reference in a new issue