@@ -67,32 +67,31 @@ impl IntoResponse for AppError {
6767
6868impl AppError {
6969 fn error_page ( & self ) -> ( StatusCode , Html < String > ) {
70- match self {
70+ let ( status , msg ) = match self {
7171 Self :: NoFile => (
7272 StatusCode :: BAD_REQUEST ,
73- Page :: error ( "No file found in request." ) ,
73+ "No file found in request. Please select an image." ,
7474 ) ,
7575 Self :: Multipart ( _) => (
7676 StatusCode :: BAD_REQUEST ,
77- Page :: error ( "There was a problem with your file upload. Please try again." ) ,
77+ "There was a problem with your file upload. Please try again." ,
7878 ) ,
7979 Self :: ImageResTooLarge => (
8080 StatusCode :: PAYLOAD_TOO_LARGE ,
81- Page :: error ( "The image resolution is too large. Maximum is 10k x 10k pixels." ) ,
81+ "The image resolution is too large. Maximum is 10k x 10k pixels." ,
8282 ) ,
8383 Self :: WrongFileType => (
8484 StatusCode :: BAD_REQUEST ,
85- Page :: error ( "Incorrect file type. Please upload a JPG, PNG, GIF, or WEBP file." ) ,
86- ) ,
87- Self :: ImageNotFound => (
88- StatusCode :: NOT_FOUND ,
89- Page :: error ( "We couldn't find that image." ) ,
85+ "Incorrect file type. Please upload a JPG, PNG, GIF, or WEBP file." ,
9086 ) ,
87+ Self :: ImageNotFound => ( StatusCode :: NOT_FOUND , "We couldn't find that image." ) ,
9188
9289 _ => (
9390 StatusCode :: INTERNAL_SERVER_ERROR ,
94- Page :: error ( "Please help I have internal errors." ) ,
91+ "Please help I have internal errors. D:" ,
9592 ) ,
96- }
93+ } ;
94+
95+ ( status, Page :: error ( status, msg) )
9796 }
9897}
0 commit comments