Don't reconnect when encountering 404
This commit is contained in:
parent
319de09c35
commit
be9d43f8cc
2 changed files with 8 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ Procedure when bumping the version number:
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- `!uptime` minute count
|
- `!uptime` minute count
|
||||||
|
- Instance reconnecting after encountering a 404 (it now stops and logs an error)
|
||||||
|
|
||||||
## v0.3.0 - 2023-02-11
|
## v0.3.0 - 2023-02-11
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use cookie::{Cookie, CookieJar};
|
||||||
use tokio::select;
|
use tokio::select;
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::{mpsc, oneshot};
|
||||||
use tokio_tungstenite::tungstenite;
|
use tokio_tungstenite::tungstenite;
|
||||||
use tokio_tungstenite::tungstenite::http::HeaderValue;
|
use tokio_tungstenite::tungstenite::http::{HeaderValue, StatusCode};
|
||||||
|
|
||||||
use crate::api::packet::ParsedPacket;
|
use crate::api::packet::ParsedPacket;
|
||||||
use crate::api::{Auth, AuthOption, Data, Nick};
|
use crate::api::{Auth, AuthOption, Data, Nick};
|
||||||
|
|
@ -364,6 +364,12 @@ impl Instance {
|
||||||
idebug!(config, "Instance dropped");
|
idebug!(config, "Instance dropped");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Err(RunError::CouldNotConnect(tungstenite::Error::Http(response)))
|
||||||
|
if response.status() == StatusCode::NOT_FOUND =>
|
||||||
|
{
|
||||||
|
iwarn!(config, "Failed to connect: room does not exist");
|
||||||
|
break;
|
||||||
|
}
|
||||||
Err(RunError::CouldNotConnect(err)) => {
|
Err(RunError::CouldNotConnect(err)) => {
|
||||||
iwarn!(config, "Failed to connect: {err}");
|
iwarn!(config, "Failed to connect: {err}");
|
||||||
false
|
false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue