Skip to content

Commit

Permalink
Merge pull request #10 from doomedcat17/development
Browse files Browse the repository at this point in the history
- SCPierApiException.java created
  • Loading branch information
doomedcat17 committed Jul 18, 2021
2 parents 78cca0e + 17a189e commit a2b0f04
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import com.doomedcat17.scpier.data.scp.SCPTranslation;
import com.doomedcat17.scpier.data.scp.ScpWikiData;
import com.doomedcat17.scpier.exception.SCPWikiContentNotFound;
import com.doomedcat17.scpier.exception.ScpierIternalException;
import com.doomedcat17.scpier.exception.SCPierApiException;
import com.doomedcat17.scpier.exception.SCPierApiInternalException;
import com.doomedcat17.scpier.mapper.scp.ScpMapperProvider;
import com.doomedcat17.scpier.mapper.scp.ScpWikiContentMapper;
import com.doomedcat17.scpier.page.PageContent;
Expand All @@ -14,7 +15,7 @@ public class ScpFoundationDataProvider {

private final PageContentProvider pageContentProvider = new PageContentProvider();

public ScpWikiData getScpWikiData(String articleName, SCPBranch scpBranch, SCPTranslation scpTranslation) throws SCPWikiContentNotFound, ScpierIternalException {
public ScpWikiData getScpWikiData(String articleName, SCPBranch scpBranch, SCPTranslation scpTranslation) throws SCPierApiException {
try {
PageContent pageContent = getPageContent(articleName, scpBranch, scpTranslation);
ScpWikiContentMapper scpWikiContentMapper = ScpMapperProvider.getScpMapper(pageContent.getName());
Expand All @@ -23,7 +24,7 @@ public ScpWikiData getScpWikiData(String articleName, SCPBranch scpBranch, SCPTr
return scpWikiData;
} catch (RuntimeException e) {
e.printStackTrace();
throw new ScpierIternalException(articleName, scpBranch, scpTranslation);
throw new SCPierApiInternalException(articleName, scpBranch, scpTranslation);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.doomedcat17.scpier.exception;

public class SCPWikiContentNotFound extends Exception {
public class SCPWikiContentNotFound extends SCPierApiException {
public SCPWikiContentNotFound(String message) {
super("Requested content is not available: "+message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.doomedcat17.scpier.exception;

public class SCPierApiException extends Exception{

public SCPierApiException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.doomedcat17.scpier.data.scp.SCPBranch;
import com.doomedcat17.scpier.data.scp.SCPTranslation;

public class ScpierIternalException extends Exception {
public ScpierIternalException(String name, SCPBranch scpBranch, SCPTranslation scpTranslation) {
public class SCPierApiInternalException extends SCPierApiException {
public SCPierApiInternalException(String name, SCPBranch scpBranch, SCPTranslation scpTranslation) {
super("Please, submit this error to scpier github issues section! https://github.com/doomedcat17/scpier/issues\n" +
"Name: "+name+", Branch: "+scpBranch+", Translation: "+scpTranslation);
}
Expand Down

This file was deleted.

0 comments on commit a2b0f04

Please sign in to comment.