mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 09:09:07 -05:00
improvement: better error messages on parse failures
This commit is contained in:
parent
e66fa4ac42
commit
9e06cc9482
|
@ -502,7 +502,7 @@ async fn nostr_server(
|
||||||
},
|
},
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
info!("invalid command ignored");
|
info!("invalid command ignored");
|
||||||
|
ws_stream.send(Message::Text(format!("[\"NOTICE\",\"{}\"]", "could not parse command"))).await.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -514,6 +514,10 @@ async fn nostr_server(
|
||||||
info!("client {:?} sent event larger ({} bytes) than max size", cid, s);
|
info!("client {:?} sent event larger ({} bytes) than max size", cid, s);
|
||||||
ws_stream.send(Message::Text(format!("[\"NOTICE\",\"{}\"]", "event exceeded max size"))).await.ok();
|
ws_stream.send(Message::Text(format!("[\"NOTICE\",\"{}\"]", "event exceeded max size"))).await.ok();
|
||||||
},
|
},
|
||||||
|
Err(Error::ProtoParseError) => {
|
||||||
|
info!("client {:?} sent event that could not be parsed", cid);
|
||||||
|
ws_stream.send(Message::Text(format!("[\"NOTICE\",\"{}\"]", "could not parse command"))).await.ok();
|
||||||
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
info!("got non-fatal error from client: {:?}, error: {:?}", cid, e);
|
info!("got non-fatal error from client: {:?}, error: {:?}", cid, e);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user