Packages

Various modules and helpers for working with Nimiq primitives in the Gleam programming language or as a CLI

Current section

Files

Jump to
nimiq_gleam src utils@misc.erl
Raw

src/utils@misc.erl

-module(utils@misc).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([unwrap/1]).
-spec unwrap({ok, IBY} | {error, any()}) -> IBY.
unwrap(Res) ->
case Res of
{ok, A} ->
A;
{error, _} ->
erlang:error(#{gleam_error => panic,
message => <<"Called unwrap on an Error value"/utf8>>,
module => <<"utils/misc"/utf8>>,
function => <<"unwrap"/utf8>>,
line => 5})
end.