Skip to content

Raise Error::CookieError more often #67

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
merged 5 commits into from
May 19, 2022
Merged

Conversation

152334H
Copy link
Contributor

@152334H 152334H commented May 18, 2022

Related to #55 #57 (not #60, that is unaddressed in this PR)

Previously:

$ leetcode t 1
[INFO  leetcode_cli::plugins::leetcode] Sending code to judge...
error: expected value at line 1 column 1

Now:

$ cargo run t 1
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/leetcode t 1`
[INFO  leetcode_cli::plugins::leetcode] Sending code to judge...
error: Your leetcode cookies seems expired, please make sure you have logined in leetcode.com with chrome.  Either you can handwrite your `LEETCODE_SESSION` and `csrf` into `leetcode.toml`, more info please checkout this: https://github.com/clearloop/leetcode-cli/blob/master/README.md#cookies

I have introduced a general method, is_session_bad(), which should reliably answer the question of, "is LEETCODE_SESSION invalid?". Emphasis on should, because I have attached no additional tests in this PR as well.
Some of the code added is not very good. Please edit/criqitue as you see fit.

@clearloop
Copy link
Owner

Great! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants