๐Ÿ€ ATproto library for gleam
atproto library gleam
34

Configure Feed

Select the types of activity you want to include in your feed.

possum/did: rename DidError to ParseError

kacaii.dev (Jul 10, 2026, 8:05 PM -0300) 906acaff 0aa4353c

+6 -3
+1
CHANGELOG.md
··· 15 15 ### Changed 16 16 17 17 - All functions now use `prepend_header` instead of `set_header`. 18 + - Renamed `did.DidError` to `did.ParseError`
+5 -3
src/possum/did.gleam
··· 16 16 17 17 pub const pattern = "^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$" 18 18 19 - // TODO: change to ParseError 20 - pub type DidError { 19 + pub type ParseError { 20 + /// Regex failed to compile 21 21 InvalidRegexPattern(pattern: String) 22 + /// String does not have a valid DID format 22 23 InvalidFormat(value: String) 24 + /// Method can only be "plc" or "web" 23 25 InvalidDidMethod(value: String) 24 26 } 25 27 ··· 125 127 /// let string = "did:plc:k5vecqzf4d5mdvkcu3mx6l5g" 126 128 /// let assert Ok(did) = did.parse(string) 127 129 /// ``` 128 - pub fn parse(content: String) -> Result(Did, DidError) { 130 + pub fn parse(content: String) -> Result(Did, ParseError) { 129 131 use with <- result.try( 130 132 regexp.from_string(pattern) 131 133 |> result.replace_error(InvalidRegexPattern(pattern:)),