-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- not throwing exceptions on parsing as errors
- preventing duplicate description retrieval
- Loading branch information
Showing
5 changed files
with
51 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/de/idrinth/waraddonclient/service/SilencingErrorHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package de.idrinth.waraddonclient.service; | ||
|
||
import de.idrinth.waraddonclient.service.logger.BaseLogger; | ||
import org.xml.sax.ErrorHandler; | ||
import org.xml.sax.SAXException; | ||
import org.xml.sax.SAXParseException; | ||
|
||
public class SilencingErrorHandler implements ErrorHandler { | ||
private final BaseLogger logger; | ||
|
||
public SilencingErrorHandler(BaseLogger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@Override | ||
public void warning(SAXParseException exception) throws SAXException { | ||
logger.info(exception); | ||
} | ||
|
||
@Override | ||
public void error(SAXParseException exception) throws SAXException { | ||
logger.warn(exception); | ||
} | ||
|
||
@Override | ||
public void fatalError(SAXParseException exception) throws SAXException { | ||
throw new SAXException(exception); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters