diff --git a/src/ec_file.erl b/src/ec_file.erl index 5714fe5..3956f6c 100644 --- a/src/ec_file.erl +++ b/src/ec_file.erl @@ -97,13 +97,14 @@ remove(Path) -> %% @doc indicates witha boolean if the path supplied refers to symlink. -spec is_symlink(path()) -> boolean(). is_symlink(Path) -> - case catch file:read_link_info(Path) of + case file:read_link_info(Path) of {ok, #file_info{type = symlink}} -> true; _ -> false end. + %% @doc make a unique temorory directory. Similar function to BSD stdlib %% function of the same name. -spec mkdtemp() -> TmpDirPath::path(). diff --git a/src/ec_semver.erl b/src/ec_semver.erl index 6a5c73d..0fc7a59 100644 --- a/src/ec_semver.erl +++ b/src/ec_semver.erl @@ -88,10 +88,10 @@ compare_toks2(_ToksA, _ToksB) -> -spec to_int(string()) -> integer(). to_int(String) -> - case catch list_to_integer(String) of - Integer when is_integer(Integer) -> - Integer; - _ -> + try + list_to_integer(String) + catch + error:badarg -> throw(invalid_semver_string) end.