Skip to content

Commit

Permalink
[refactor] Improve WebDAV error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Feb 9, 2022
1 parent 2aeffb9 commit 96b7964
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public CollectionResource createCollection(String name)

} catch (CollectionExistsException | EXistException ex) {
LOG.debug(ex.getMessage());
throw new ConflictException(this);
throw new ConflictException(this, "Create Collection '" + getXmldbUri().append(name) + "' failed: " + ex.getMessage());

}

Expand Down Expand Up @@ -243,8 +243,7 @@ public Resource createNew(String newName, InputStream is, Long length, String co

} catch (PermissionDeniedException | CollectionDoesNotExistException | IOException e) {
LOG.debug(e.getMessage());
throw new ConflictException(this);

throw new ConflictException(this, "Create New '" + getXmldbUri().append(newName) + "' failed: " + e.getMessage());
}
return resource;
}
Expand Down Expand Up @@ -326,7 +325,7 @@ public void moveTo(CollectionResource rDest, String newName) throws ConflictExce
existCollection.resourceCopyMove(destCollection, newName, Mode.MOVE);

} catch (EXistException ex) {
throw new ConflictException(this);
throw new ConflictException(this, "Move '" + getXmldbUri() + "' to '" + destCollection.append(newName) + "' failed: " + ex.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void moveTo(CollectionResource rDest, String newName) throws ConflictExce
existDocument.resourceCopyMove(destCollection, newName, Mode.MOVE);

} catch (EXistException ex) {
throw new ConflictException(this);
throw new ConflictException(this, "Move '" + getXmldbUri() + "' to '" + destCollection.append(newName) + "' failed: " + ex.getMessage());
}
}

Expand Down

0 comments on commit 96b7964

Please sign in to comment.