Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: friendly error tips #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
clearloop merged 1 commit into clearloop:master from wendajiang:master
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/err.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum Error {
DecryptError,
SilentError,
NoneError,
ChromeNotLogin,
}

impl std::fmt::Debug for Error {
Expand Down Expand Up @@ -57,7 +58,8 @@ impl std::fmt::Debug for Error {
Error::NoneError => write!(f,
"json from response parse failed, please open a new issue at: {}.",
"https://github.com/clearloop/leetcode-cli/".underline(),
)
),
Error::ChromeNotLogin => write!(f, "maybe you not login on the Chrome, you can login and retry.")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/chrome.rs
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ pub fn cookies() -> Result<Ident, crate::Error> {
}

Ok(Ident {
csrf: m.get("csrftoken").ok_or(Error::NoneError)?.to_string(),
csrf: m.get("csrftoken").ok_or(Error::ChromeNotLogin)?.to_string(),
session: m
.get("LEETCODE_SESSION")
.ok_or(Error::NoneError)?
.ok_or(Error::ChromeNotLogin)?
.to_string(),
})
}
Expand Down

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /