-module(gilly@error). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/gilly/error.gleam"). -export([describe_error/1]). -export_type([error/0]). -type error() :: {unsupported_file_type, binary(), list(binary())} | {reading_file, binary(), simplifile:file_error()} | {parsing_open_a_p_i, binary(), gilly@openapi@error:error()}. -file("src/gilly/error.gleam", 24). -spec describe_error(error()) -> binary(). describe_error(Error) -> case Error of {unsupported_file_type, Source, Supported} -> <<<<<<"Unsupported file type for '"/utf8, Source/binary>>/binary, "'. Supported file types are: "/utf8>>/binary, (gleam@string:join(Supported, <<", "/utf8>>))/binary>>; {reading_file, Source@1, Inner} -> <<<<<<"Failed to read file '"/utf8, Source@1/binary>>/binary, "': "/utf8>>/binary, (simplifile:describe_error(Inner))/binary>>; {parsing_open_a_p_i, Source@2, Inner@1} -> <<<<<<"Failed to parse OpenAPI specification from file '"/utf8, Source@2/binary>>/binary, "': "/utf8>>/binary, (gilly@openapi@error:describe_error(Inner@1))/binary>> end.