fix: return immediately on non-200
This commit is contained in:
parent
04bfa2c1ae
commit
2c9baa16df
1 changed files with 2 additions and 0 deletions
|
@ -94,6 +94,7 @@ async fn handler(cfg: &Config, s: &mut State) -> Result<(), reqwest::Error> {
|
|||
])
|
||||
.send()
|
||||
.await?
|
||||
.error_for_status()?
|
||||
.json::<TgResponse>()
|
||||
.await?
|
||||
.result;
|
||||
|
@ -112,6 +113,7 @@ async fn handler(cfg: &Config, s: &mut State) -> Result<(), reqwest::Error> {
|
|||
{
|
||||
let mut args = text.split_whitespace();
|
||||
args.next(); // skip command name
|
||||
|
||||
match args.next()? {
|
||||
"ru" => {
|
||||
let comic_id = args.next()?.parse::<u16>().ok()?;
|
||||
|
|
Loading…
Add table
Reference in a new issue