Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Fetch system index mappings from json file instead of string constants #3153

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: changing exception being thrown
Signed-off-by: Pavan Yekbote <mail2pavanyekbote@gmail.com>
  • Loading branch information
pyek-bot committed Oct 23, 2024
commit 7068729e11a17fa68cba44716fd1c9b9516dbcd3
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import java.net.URL;
import java.util.Map;

import com.fasterxml.jackson.core.JsonParseException;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;

import com.google.gson.JsonSyntaxException;
import lombok.extern.log4j.Log4j2;

@Log4j2
Expand Down Expand Up @@ -47,7 +47,7 @@ public static String getMappingFromFile(String path) throws IOException {

String mapping = Resources.toString(url, Charsets.UTF_8);
if (!StringUtils.isJson(mapping)) {
throw new JsonParseException("Mapping is not a valid JSON: " + path);
throw new JsonSyntaxException("Mapping is not a valid JSON: " + path);
}

return mapping;
Expand Down