Revert "Bug 564634 - don't throw errors from
ContentTypeCatalog.describe"

This reverts commit 075ec9dc4a78f56909f95da879ba160f67d3496b.

The IContentTypeManagerTest that is in resources tests fails with that,
pointing to bug 67841, so the fix for bug 564634 breaks bug 67841 fix.

Change-Id: Id64e5c11b442b6c615fc32db2b749ec962af1d31
diff --git a/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java b/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java
index 37ae65e..6399c37 100644
--- a/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java
+++ b/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java
@@ -214,7 +214,7 @@
 		}
 	}
 
-	private int collectMatchingByContents(int valid, IContentType[] subset, List<ContentType> destination, ILazySource contents, Map<String, Object> properties) {
+	private int collectMatchingByContents(int valid, IContentType[] subset, List<ContentType> destination, ILazySource contents, Map<String, Object> properties) throws IOException {
 		for (IContentType element : subset) {
 			ContentType current = (ContentType) element;
 			IContentDescriber describer = current.getDescriber();
@@ -236,7 +236,7 @@
 	}
 
 	@SuppressWarnings("deprecation")
-	int describe(ContentType type, ILazySource contents, ContentDescription description, Map<String, Object> properties) {
+	int describe(ContentType type, ILazySource contents, ContentDescription description, Map<String, Object> properties) throws IOException {
 		IContentDescriber describer = type.getDescriber();
 		try {
 			if (contents.isText()) {
@@ -258,12 +258,12 @@
 			// describer seems to be buggy. just disable it (logging the reason)
 			type.invalidateDescriber(re);
 		} catch (Error e) {
-			// describer got some serious problem. disable it (logging the reason)
+			// describer got some serious problem. disable it (logging the reason) and throw the error again
 			type.invalidateDescriber(e);
+			throw e;
 		} catch (LowLevelIOException llioe) {
-			// describer got some IO problem. Log the reason
-			String message = NLS.bind(ContentMessages.content_errorReadingContents, type.getId());
-			ContentType.log(message, llioe.getActualException());
+			// throw the actual exception
+			throw llioe.getActualException();
 		} catch (IOException ioe) {
 			// bugs 67841/ 62443  - non-low level IOException should be "ignored"
 			String message = NLS.bind(ContentMessages.content_errorReadingContents, type.getId());
@@ -328,7 +328,7 @@
 		return true;
 	}
 
-	IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream contents, String fileName) {
+	IContentType[] findContentTypesFor(ContentTypeMatcher matcher, InputStream contents, String fileName) throws IOException {
 		final ILazySource buffer = ContentTypeManager.readBuffer(contents);
 		IContentType[] selected = internalFindContentTypesFor(matcher, buffer, fileName, true);
 		// give the policy a chance to change the results
@@ -432,7 +432,7 @@
 		return true;
 	}
 
-	private IContentType[] internalFindContentTypesFor(ILazySource buffer, IContentType[][] subset,Comparator<IContentType> validPolicy, Comparator<IContentType> indeterminatePolicy) {
+	private IContentType[] internalFindContentTypesFor(ILazySource buffer, IContentType[][] subset, Comparator<IContentType> validPolicy, Comparator<IContentType> indeterminatePolicy) throws IOException {
 		Map<String, Object> properties = new HashMap<>();
 		final List<ContentType> appropriate = new ArrayList<>(5);
 		final int validFullName = collectMatchingByContents(0, subset[0], appropriate, buffer, properties);
@@ -462,7 +462,7 @@
 		return result;
 	}
 
-	private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, ILazySource buffer, String fileName, boolean forceValidation) {
+	private IContentType[] internalFindContentTypesFor(ContentTypeMatcher matcher, ILazySource buffer, String fileName, boolean forceValidation) throws IOException {
 		final IContentType[][] subset;
 		final Comparator<IContentType> validPolicy;
 		Comparator<IContentType> indeterminatePolicy;