File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub enum Error {
1919 DecryptError ,
2020 SilentError ,
2121 NoneError ,
22+ ChromeNotLogin ,
2223}
2324
2425impl std:: fmt:: Debug for Error {
@@ -57,7 +58,8 @@ impl std::fmt::Debug for Error {
5758 Error :: NoneError => write ! ( f,
5859 "json from response parse failed, please open a new issue at: {}." ,
5960 "https://github.com/clearloop/leetcode-cli/" . underline( ) ,
60- )
61+ ) ,
62+ Error :: ChromeNotLogin => write ! ( f, "maybe you not login on the Chrome, you can login and retry." )
6163 }
6264 }
6365}
Original file line number Diff line number Diff line change @@ -85,10 +85,10 @@ pub fn cookies() -> Result<Ident, crate::Error> {
8585 }
8686
8787 Ok ( Ident {
88- csrf : m. get ( "csrftoken" ) . ok_or ( Error :: NoneError ) ?. to_string ( ) ,
88+ csrf : m. get ( "csrftoken" ) . ok_or ( Error :: ChromeNotLogin ) ?. to_string ( ) ,
8989 session : m
9090 . get ( "LEETCODE_SESSION" )
91- . ok_or ( Error :: NoneError ) ?
91+ . ok_or ( Error :: ChromeNotLogin ) ?
9292 . to_string ( ) ,
9393 } )
9494}
You can’t perform that action at this time.
0 commit comments