- commented error logging for ImageInfo loading (#4385)
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 15 Dec 2014 15:56:55 +0000 (15:56 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 15 Dec 2014 15:56:55 +0000 (15:56 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java

index 0f19002fe4a251f20587af23880f9f45deaff0cd..6a7b2f2832d701b872558711e02d2e0971b49922 100644 (file)
@@ -17,11 +17,11 @@ import java.util.Collection;
 import org.apache.http.HttpException;
 import org.eclipse.swt.events.SelectionListener;
 
+import eu.etaxonomy.cdm.common.UriUtils;
 import eu.etaxonomy.cdm.common.media.ImageInfo;
 import eu.etaxonomy.cdm.model.media.ImageFile;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -109,7 +109,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                        ImageFile imageFile = (ImageFile) mediaRepresentationPart;
 
                        URI uri = imageFile.getUri();
-                       if(uri == null){
+                       if(!UriUtils.isServiceAvailable(uri)){
                                return;
                        }
                        try {
@@ -119,10 +119,14 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
                                getEntity().setMimeType(mimeType);
                                text_suffix.setText(imageInfo.getSuffix());
                                getEntity().setSuffix(imageInfo.getSuffix());
-                       } catch (IOException e) {
-                               MessagingUtils.error(getClass(), e);
-                       } catch (HttpException e) {
-                               MessagingUtils.error(getClass(), e);
+                       }
+                       //theses exceptions do not need to be logged
+                       //especially because this happens with every key stroke
+                       catch (IOException e) {
+//                             MessagingUtils.error(getClass(), e);
+                       }
+                       catch (HttpException e) {
+//                             MessagingUtils.error(getClass(), e);
                        }
                }
        }