Skip to content

Commit a72b80c

Browse files
philboeselagercboehme
authored andcommitted
RestMap: catch all exceptions by returning null, hbz/lobid-organisations#49
1 parent 704d4ad commit a72b80c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/java/org/culturegraph/mf/morph/maps/RestMap.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.culturegraph.mf.morph.maps;
1717

1818
import java.io.BufferedReader;
19-
import java.io.FileNotFoundException;
2019
import java.io.IOException;
2120
import java.io.InputStream;
2221
import java.io.InputStreamReader;
@@ -27,8 +26,6 @@
2726
import java.util.regex.Matcher;
2827
import java.util.regex.Pattern;
2928

30-
import org.culturegraph.mf.exceptions.MetafactureException;
31-
3229
/**
3330
* @author "Markus Michael Geipel", "Philipp v. Böselager"
3431
*
@@ -53,11 +50,8 @@ public String get(final Object key) {
5350
String urlString = matcher.replaceAll(key.toString());
5451
return readFromUrl(urlString);
5552
} catch (IOException | URISyntaxException e) {
56-
if (e instanceof FileNotFoundException) {
57-
// There was no data result for the given URL
58-
return null;
59-
}
60-
throw new MetafactureException(e);
53+
// There was no data result for the given URL
54+
return null;
6155
}
6256
}
6357

0 commit comments

Comments
 (0)