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

Expose exceptions in DumpProcessingController #526

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wetneb
Copy link
Member

@wetneb wetneb commented Feb 1, 2021

Those are the changes proposed by @brett-matson in #523, minus the unrelated commits.

@codecov
Copy link

codecov bot commented Feb 1, 2021

Codecov Report

Merging #526 (3406b6a) into master (d6cecbd) will increase coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head 3406b6a differs from pull request most recent head b38cd5e. Consider uploading reports for the commit b38cd5e to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master     #526      +/-   ##
============================================
+ Coverage     81.02%   81.07%   +0.04%     
- Complexity     2085     2128      +43     
============================================
  Files           149      148       -1     
  Lines          7293     7354      +61     
  Branches        895      902       +7     
============================================
+ Hits           5909     5962      +53     
- Misses         1115     1122       +7     
- Partials        269      270       +1     
Impacted Files Coverage Δ Complexity Δ
...idata/wdtk/dumpfiles/DumpProcessingController.java 61.90% <0.00%> (-3.92%) 32.00 <0.00> (ø)
...kidata/wdtk/datamodel/implementation/TermImpl.java 71.42% <0.00%> (-11.91%) 5.00% <0.00%> (ø%)
...a/wdtk/datamodel/interfaces/StatementDocument.java 68.35% <0.00%> (-3.65%) 45.00% <0.00%> (ø%)
...org/wikidata/wdtk/datamodel/helpers/Datamodel.java 87.71% <0.00%> (-2.85%) 47.00% <0.00%> (+2.00%) ⬇️
...a/wdtk/datamodel/implementation/StatementImpl.java 93.33% <0.00%> (-0.18%) 23.00% <0.00%> (-1.00%)
...a/org/wikidata/wdtk/wikibaseapi/ApiConnection.java 90.29% <0.00%> (ø) 41.00% <0.00%> (ø%)
...org/wikidata/wdtk/wikibaseapi/StatementUpdate.java 84.54% <0.00%> (ø) 64.00% <0.00%> (ø%)
...kidata/wdtk/datamodel/implementation/SnakImpl.java 100.00% <0.00%> (ø) 5.00% <0.00%> (+1.00%)
...idata/wdtk/datamodel/helpers/JsonDeserializer.java 95.23% <0.00%> (ø) 6.00% <0.00%> (ø%)
...idata/wdtk/datamodel/implementation/ValueImpl.java 97.36% <0.00%> (ø) 2.00% <0.00%> (ø%)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6cecbd...b38cd5e. Read the comment docs.

Copy link
Collaborator

@Tpt Tpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks globally fine to me. I just have two improvement suggestions

@@ -374,7 +374,8 @@ public Sites getSitesInformation() throws IOException {
* @see DumpProcessingController#processDump(MwDumpFile)
* @see DumpProcessingController#getMostRecentDump(DumpContentType)
*/
public void processAllRecentRevisionDumps() {
public void processAllRecentRevisionDumps()
throws IOException, FileAlreadyExistsException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FileAlreadyExistsException is a sub class of IOException (same in other places)

Copy link
Member Author

@wetneb wetneb Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps there is still a case for including both of them explicitly in the signature, because the caller might want to handle them differently?

+ " already exists. Try deleting the file or dumpfile directory to attempt a new download.");
+ " already exists. Try deleting the file or dumpfile directory to attempt a new download.";
logger.error(errorMessage);
throw new FileAlreadyExistsException(errorMessage);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to give to the constructor the file names to allow getFile() to be used by the caller. C.f. doc

+ dumpFile.toString()
+ " could not be processed since file "
+ e.getFile()
+ " already exists. Try deleting the file or dumpfile directory to attempt a new download.");
+ " already exists. Try deleting the file or dumpfile directory to attempt a new download.";
logger.error(errorMessage);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure the logging is still useful now that we raise the exception again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No ability to detect dump processing failure
3 participants