diff --git a/src/possum/at_uri.gleam b/src/possum/at_uri.gleam index a36438c..d06dfe4 100644 --- a/src/possum/at_uri.gleam +++ b/src/possum/at_uri.gleam @@ -16,8 +16,8 @@ pub type ParseError { InvalidHandleAuthority(reason: handle.ParseError) /// Authority not a valid DID InvalidDidAuthority(reason: did.ParseError) - /// Something else went wrong - InvalidFormat(value: String) + /// Authority is an empty string + MissingAuthority } pub type Authority { @@ -87,8 +87,8 @@ pub fn parse(content: String) -> Result(AtUri, ParseError) { }) case string.split(value, on: "/") { - // Honestly I dont know how this one could happen. - [] -> Error(InvalidFormat(value:)) + // `rest` is an empty string + [] -> Error(MissingAuthority) // Contains only authority (DID or handle) // ex: at://kacaii.dev