Current section

Files

Jump to
sprocket src sprocket@internal@exceptions.erl
Raw

src/sprocket@internal@exceptions.erl

-module(sprocket@internal@exceptions).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([throw_on_unexpected_deps_mismatch/1, throw_on_unexpected_hook_result/1]).
-spec throw_on_unexpected_deps_mismatch(any()) -> any().
throw_on_unexpected_deps_mismatch(Meta) ->
sprocket@internal@logger:error(
<<"
An unexpected change in hook dependencies was encountered. This means that the list of hook
dependencies dynamically changed after the initial render. This is not supported and will
result in undefined behavior.
"/utf8>>
),
gleam@io:debug(Meta),
erlang:error(#{gleam_error => panic,
message => <<"panic expression evaluated"/utf8>>,
module => <<"sprocket/internal/exceptions"/utf8>>,
function => <<"throw_on_unexpected_deps_mismatch"/utf8>>,
line => 16}).
-spec throw_on_unexpected_hook_result(any()) -> any().
throw_on_unexpected_hook_result(Meta) ->
sprocket@internal@logger:error(
<<"
An unexpected hook result was encountered. This means that a hook was dynamically added
after the initial render. This is not supported and will result in undefined behavior.
"/utf8>>
),
gleam@io:debug(Meta),
erlang:error(#{gleam_error => panic,
message => <<"panic expression evaluated"/utf8>>,
module => <<"sprocket/internal/exceptions"/utf8>>,
function => <<"throw_on_unexpected_hook_result"/utf8>>,
line => 30}).