-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chimera: update FsSqlDriver#inodeOf to throw exception if file not found
Motivation: Currently, `FsSqlDriver#inodeOf` returns `null` if the target directory element does not exist. Returning a `null` value is inherently dangerous operation, so this operation is undesirable. Moreover, in many places in the code, the return value is checked for the `null` value and, if present, the code throws a corresponding `FileNotFoundChimeraException`. This is not DRY. Modification: Update `FsSqlDriver#inodeOf` so it now never returns a `null` value. Instead, the method will throw FileNotFoundException if the target does not exist. Remove redundant code that checked for a `null` value and throws a `FileNotFoundChimeraException`. Update a few places where a special value (either `null` or an empty collection) is returned so they continue to support returning this value. Result: No user or admin observable changes. The code base is (hopefully) simpler and easier to maintain. Target: master Requires-notes: no Requires-book: no Acked-by: Tigran Mkrtchyan Patch: https://rb.dcache.org/r/14033/
- Loading branch information
1 parent
c425a62
commit 2fb9170
Showing
2 changed files
with
42 additions
and
61 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