Skip to content

Commit

Permalink
Merge branch 'dgud/public_key/fix-error-reason/GH-8604/OTP-19183' int…
Browse files Browse the repository at this point in the history
…o maint

* dgud/public_key/fix-error-reason/GH-8604/OTP-19183:
  Improve error handling
  • Loading branch information
dgud committed Aug 16, 2024
2 parents 5452810 + f2599b4 commit 096c279
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/public_key/src/pubkey_os_cacerts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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} ->
Expand Down

0 comments on commit 096c279

Please sign in to comment.