Packages

A Sketch runtime package, made to generate CSS!

Current section

Files

Jump to
sketch_css src sketch@css@error.erl
Raw

src/sketch@css@error.erl

-module(sketch@css@error).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([simplifile/1, glance/1, not_a_directory/1]).
-export_type([error/0]).
-type error() :: {application_error, binary()} |
{simplifile_error, simplifile:file_error()} |
{glance_error, glance:error()}.
-spec simplifile({ok, NPO} | {error, simplifile:file_error()}) -> {ok, NPO} |
{error, error()}.
simplifile(Err) ->
gleam@result:map_error(Err, fun(Field@0) -> {simplifile_error, Field@0} end).
-spec glance({ok, NPR} | {error, glance:error()}) -> {ok, NPR} |
{error, error()}.
glance(Err) ->
gleam@result:map_error(Err, fun(Field@0) -> {glance_error, Field@0} end).
-spec not_a_directory(binary()) -> {ok, any()} | {error, error()}.
not_a_directory(Dir) ->
Error = {application_error, <<Dir/binary, " is not a directory"/utf8>>},
{error, Error}.