@@ -13,15 +13,6 @@ type TokenError = oauth2::RequestTokenError<
1313/// The main error type for tmc-client.
1414#[ derive( Debug , Error ) ]
1515pub enum ClientError {
16- // Arc
17- #[ error( "Tried to mutate client while it was borrowed" ) ]
18- ArcBorrowed ,
19-
20- // file IO
21- #[ error( "Failed to create temporary file" ) ]
22- TempFile ( #[ source] std:: io:: Error ) ,
23-
24- // network
2516 #[ error( "HTTP error {status} for {url}: {error}. Obsolete client: {obsolete_client}" ) ]
2617 HttpError {
2718 url : Url ,
@@ -33,37 +24,23 @@ pub enum ClientError {
3324 ConnectionError ( Method , Url , #[ source] reqwest:: Error ) ,
3425 #[ error( "OAuth2 password exchange error" ) ]
3526 Token ( #[ source] Box < TokenError > ) ,
36- #[ error( "OAuth2 unexpected token response: {0}" ) ]
37- TokenParse ( String , #[ source] serde_json:: error:: Error ) ,
3827 #[ error( "Failed to parse as URL: {0}" ) ]
3928 UrlParse ( String , #[ source] url:: ParseError ) ,
4029 #[ error( "Failed to write response" ) ]
4130 HttpWriteResponse ( #[ source] reqwest:: Error ) ,
4231 #[ error( "Failed to deserialize response from {0} as JSON" ) ]
4332 HttpJsonResponse ( Url , #[ source] reqwest:: Error ) ,
4433
45- #[ error( "Failed to download some exercises" ) ]
46- IncompleteDownloadResult {
47- downloaded : Vec < usize > ,
48- failed : Vec < ( usize , Box < ClientError > ) > ,
49- } ,
50-
5134 #[ error( "Already authenticated" ) ]
5235 AlreadyAuthenticated ,
5336 #[ error( "Authentication required" ) ]
54- NotLoggedIn ,
55- #[ error( "Failed to find cache directory" ) ]
56- CacheDir ,
57- #[ error( "No values found in exercise details map returned by server" ) ]
58- MissingDetailsValue ,
59- #[ error( "List of exercises given was empty" ) ]
60- NoExercisesGiven ,
37+ NotAuthenticated ,
6138
6239 #[ error( transparent) ]
6340 SystemTime ( #[ from] std:: time:: SystemTimeError ) ,
6441 #[ error( transparent) ]
6542 WalkDir ( #[ from] walkdir:: Error ) ,
66- #[ error( "File IO error" ) ]
43+ #[ error( transparent ) ]
6744 FileError ( #[ from] FileError ) ,
6845 #[ error( transparent) ]
6946 Plugin ( #[ from] tmc_langs_plugins:: PluginError ) ,
0 commit comments