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()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
|
.error_for_status()?
|
||||||
.json::<TgResponse>()
|
.json::<TgResponse>()
|
||||||
.await?
|
.await?
|
||||||
.result;
|
.result;
|
||||||
|
@ -112,6 +113,7 @@ async fn handler(cfg: &Config, s: &mut State) -> Result<(), reqwest::Error> {
|
||||||
{
|
{
|
||||||
let mut args = text.split_whitespace();
|
let mut args = text.split_whitespace();
|
||||||
args.next(); // skip command name
|
args.next(); // skip command name
|
||||||
|
|
||||||
match args.next()? {
|
match args.next()? {
|
||||||
"ru" => {
|
"ru" => {
|
||||||
let comic_id = args.next()?.parse::<u16>().ok()?;
|
let comic_id = args.next()?.parse::<u16>().ok()?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue