diff --git a/lib/public_key/src/pubkey_os_cacerts.erl b/lib/public_key/src/pubkey_os_cacerts.erl index 2cc028be5f57..6fa5fdb9a669 100644 --- a/lib/public_key/src/pubkey_os_cacerts.erl +++ b/lib/public_key/src/pubkey_os_cacerts.erl @@ -54,19 +54,20 @@ get() -> %% (Re)Load default os cacerts and cache result. -spec load() -> ok | {error, Reason::term()}. load() -> + DefError = {error, no_cacerts_found}, case os:type() of {unix, linux} -> - load(linux_paths(), undefined); + load(linux_paths(), DefError); {unix, openbsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, freebsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, dragonfly} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, netbsd} -> - load(bsd_paths(), undefined); + load(bsd_paths(), DefError); {unix, sunos} -> - load(sunos_paths(), undefined); + load(sunos_paths(), DefError); {win32, _} -> load_win32(); {unix, darwin} ->