Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/FileTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ end
Args:
filename (String) i.e filepath
Returns:
FileType.Type object
FileType.Type object or nothing if the file is not recognized
"""
function matcher(filename::String)::FileType.Type
function matcher(filename::String)::Union{FileType.Type, Nothing}
try
if isfile(filename)
f=open(filename)
Expand All @@ -55,6 +55,7 @@ function matcher(filename::String)::FileType.Type
end
end
end
return nothing
else
throw(error("file not found"))
end
Expand Down Expand Up @@ -106,4 +107,4 @@ function is_mime_supported(mime::MIME)::Bool
end

export FileType
end
end
Loading