@@ -11,49 +11,53 @@ pub enum AppError {
1111 // File errors
1212 FileNotFound ,
1313 CreateFileFailed ( String ) ,
14+ DeleteFileFailed ( String ) ,
1415
1516 // Tag errors
1617 TagNotFound ,
1718 CreateTagFailed ( String ) ,
19+ DeleteTagFailed ( String ) ,
1820
19- // NewGroupTag errors
20- NewGroupTagNotFound ,
21+ // GroupTag errors
22+ GroupTagNotFound ,
2123 CannotAssociateWithPrimary ,
22- CreateNewGroupTagFailed ( String ) ,
23- DeleteNewGroupTagFailed ( String ) ,
24+ CreateGroupTagFailed ( String ) ,
25+ DeleteGroupTagFailed ( String ) ,
2426
25- // NewFileGroup errors
26- NewFileGroupNotFound ,
27- CreateNewFileGroupFailed ( String ) ,
28- DeleteNewFileGroupFailed ( String ) ,
29-
30- // DieselError errors
31- DieselError ( DieselError ) ,
27+ // FileGroup errors
28+ FileGroupNotFound ,
29+ CreateFileGroupFailed ( String ) ,
30+ DeleteFileGroupFailed ( String ) ,
3231
3332 // Validation errors
3433 ValidationError ( String ) ,
34+
35+ // DieselError errors
36+ DieselError ( DieselError ) ,
3537}
3638
3739impl Display for AppError {
3840 fn fmt ( & self , f : & mut Formatter ) -> Result {
3941 match self {
4042 AppError :: GroupNotFound => write ! ( f, "Group not found" ) ,
4143 AppError :: CreateGroupFailed ( msg) => write ! ( f, "Create group failed: {}" , msg) ,
42- AppError :: DieselError ( e) => write ! ( f, "Database error: {}" , e) ,
43- AppError :: ValidationError ( msg) => write ! ( f, "Validation error: {}" , msg) ,
4444 AppError :: DeleteGroupFailed ( msg) => write ! ( f, "Delete group failed: {}" , msg) ,
4545 AppError :: FileNotFound => write ! ( f, "File not found" ) ,
4646 AppError :: CreateFileFailed ( msg) => write ! ( f, "Create file failed: {}" , msg) ,
47+ AppError :: DeleteFileFailed ( msg) => write ! ( f, "Delete file failed: {}" , msg) ,
4748 AppError :: TagNotFound => write ! ( f, "Tag not found" ) ,
4849 AppError :: CreateTagFailed ( msg) => write ! ( f, "Create tag failed: {}" , msg) ,
49- AppError :: NewGroupTagNotFound => write ! ( f, "NewGroupTag not found" ) ,
50+ AppError :: DeleteTagFailed ( msg) => write ! ( f, "Delete tag failed: {}" , msg) ,
51+ AppError :: GroupTagNotFound => write ! ( f, "GroupTag not found" ) ,
5052 AppError :: CannotAssociateWithPrimary => write ! ( f, "Cannot associate with primary group" ) ,
51- AppError :: CreateNewGroupTagFailed ( msg) => write ! ( f, "Create NewGroupTag failed: {}" , msg) ,
52- AppError :: DeleteNewGroupTagFailed ( msg) => write ! ( f, "Delete NewGroupTag failed: {}" , msg) ,
53- AppError :: NewFileGroupNotFound => write ! ( f, "NewFileGroup not found" ) ,
54- AppError :: CreateNewFileGroupFailed ( msg) => write ! ( f, "Create NewFileGroup failed: {}" , msg) ,
55- AppError :: DeleteNewFileGroupFailed ( msg) => write ! ( f, "Delete NewFileGroup failed: {}" , msg) ,
56- // 其他错误处理...
53+ AppError :: CreateGroupTagFailed ( msg) => write ! ( f, "Create GroupTag failed: {}" , msg) ,
54+ AppError :: DeleteGroupTagFailed ( msg) => write ! ( f, "Delete GroupTag failed: {}" , msg) ,
55+ AppError :: FileGroupNotFound => write ! ( f, "FileGroup not found" ) ,
56+ AppError :: CreateFileGroupFailed ( msg) => write ! ( f, "Create FileGroup failed: {}" , msg) ,
57+ AppError :: DeleteFileGroupFailed ( msg) => write ! ( f, "Delete FileGroup failed: {}" , msg) ,
58+ AppError :: ValidationError ( msg) => write ! ( f, "Validation error: {}" , msg) ,
59+ AppError :: DieselError ( e) => write ! ( f, "Database error: {}" , e) ,
60+ // other Errors...
5761 _ => write ! ( f, "Unknown error occurred" ) ,
5862 }
5963 }
0 commit comments