This is an automated email from the ASF dual-hosted git repository.

ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new cb3260b  Minor: Return bad Image MIME type to API client
cb3260b is described below

commit cb3260b61f3454244afdaac3d1bcb154fb0a35e5
Author: Michael Vorburger <[email protected]>
AuthorDate: Thu Oct 22 01:33:19 2020 +0200

    Minor: Return bad Image MIME type to API client
---
 .../fineract/infrastructure/core/exception/ImageUploadException.java  | 4 ++--
 .../documentmanagement/contentrepository/ContentRepositoryUtils.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
index f28847d..3fec6bc 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/exception/ImageUploadException.java
@@ -20,7 +20,7 @@ package org.apache.fineract.infrastructure.core.exception;
 
 public class ImageUploadException extends AbstractPlatformDomainRuleException {
 
-    public ImageUploadException() {
-        super("error.msg.image.type.upload", "Only image files of type GIF,PNG 
and JPG are allowed ");
+    public ImageUploadException(String badMimeType) {
+        super("error.msg.image.type.upload", "Only image files of type GIF,PNG 
and JPG are allowed, but not: " + badMimeType);
     }
 }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
index cd61dc8..b50d391 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
@@ -121,7 +121,7 @@ public final class ContentRepositoryUtils {
     public static void validateImageMimeType(final String mimeType) {
         if (!(mimeType.equalsIgnoreCase(ImageMIMEtype.GIF.getValue()) || 
mimeType.equalsIgnoreCase(ImageMIMEtype.JPEG.getValue())
                 || mimeType.equalsIgnoreCase(ImageMIMEtype.PNG.getValue()))) {
-            throw new ImageUploadException();
+            throw new ImageUploadException(mimeType);
         }
     }
 

Reply via email to