Skip to content

Commit 6824e2d

Browse files
committed
add error message
1 parent c742daa commit 6824e2d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/ac_scraper.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ pub async fn get_sample_cases(
561561
.await?
562562
.error_for_status()?
563563
.text()
564-
.await?;
564+
.await
565+
.with_context(|| "Failed to get sample cases. Please check you logged in and try again.")?;
565566
let doc = Html::parse_document(&body);
566567

567568
let pre_selector = Selector::parse("pre").unwrap();

src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ pub async fn get_problem_info_from_path(
313313
};
314314
let problem_str_info = get_problem_str_info(&problem_info);
315315
let (problem_info, problem_str_info) =
316-
add_task_name_to_problem_info(acn, problem_info, problem_str_info).await?;
316+
add_task_name_to_problem_info(acn, problem_info, problem_str_info)
317+
.await
318+
.with_context(|| {
319+
"Failed to get task name. Please check you logged in and the contest exists"
320+
})?;
317321
return Ok((problem_info, problem_str_info));
318322
}
319323

0 commit comments

Comments
 (0)