Skip to content

Commit

Permalink
Merge pull request #36 from invenia/bc/argument-error-fix
Browse files Browse the repository at this point in the history
Fix and test ArgumentError for nonexistant dir
  • Loading branch information
bencottier authored Oct 13, 2021
2 parents 9e0b661 + 21cde53 commit 72299dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Checkpoints"
uuid = "b4a3413d-e481-5afc-88ff-bdfbd6a50dce"
authors = "Invenia Technical Computing Corporation"
version = "0.3.13"
version = "0.3.14"

[deps]
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Expand Down
2 changes: 1 addition & 1 deletion src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ You can also work with it directly, say you wanted to get all checkpoints files
2: https://github.com/JuliaData/DataFrames.jl
"""
function index_checkpoint_files(dir::AbstractPath)
isdir(dir) || throw(ArgumentError(dir, "Need an existing directory."))
isdir(dir) || throw(ArgumentError("Need an existing directory."))
map(Iterators.filter(==("jlso") extension, walkpath(dir))) do checkpoint_path
return IndexEntry(checkpoint_path)
end
Expand Down
4 changes: 4 additions & 0 deletions test/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@
@test_throws ErrorException entry.tags
end
end

@testset "nonexistent dir" begin
@test_throws ArgumentError index_checkpoint_files("nonexistent_dir")
end
end

2 comments on commit 72299dd

@bencottier
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/46703

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.14 -m "<description of version>" 72299dd1d24b994b2919d999055cb386761bbb2c
git push origin v0.3.14

Please sign in to comment.