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

Configure Feed

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

possum/did, possum/handle: rename InvalidFormat to InvalidSyntax

kacaii.dev (Jul 11, 2026, 11:25 AM -0300) 836176d9 b03451de

+7 -5
+2
CHANGELOG.md
··· 16 16 17 17 - All functions now use `prepend_header` instead of `set_header`. 18 18 - Renamed `did.DidError` to `did.ParseError` 19 + - Rename `did.InvalidFormat` to `did.InvalidSyntax` 20 + - Rename `handle.InvalidFormat` to `handle.InvalidSyntax`
+2 -2
src/possum/did.gleam
··· 20 20 /// Regex failed to compile 21 21 InvalidRegexPattern(pattern: String) 22 22 /// String does not have a valid DID format 23 - InvalidFormat(value: String) 23 + InvalidSyntax(value: String) 24 24 /// Method can only be "plc" or "web" 25 25 InvalidDidMethod(value: String) 26 26 } ··· 135 135 136 136 use value <- result.try(case regexp.check(with:, content:) { 137 137 True -> Ok(content) 138 - False -> Error(InvalidFormat(content)) 138 + False -> Error(InvalidSyntax(content)) 139 139 }) 140 140 141 141 case string.trim(value) {
+2 -2
src/possum/handle.gleam
··· 15 15 /// Regex failed to compile 16 16 InvalidRegexPattern(pattern: String) 17 17 /// String does not have a valid handle format 18 - InvalidFormat(value: String) 18 + InvalidSyntax(value: String) 19 19 /// "Reserved" top-level domains should not fail syntax validation, 20 20 /// but they must immediately fail any attempt at registration. 21 21 /// ··· 53 53 54 54 use value <- result.try(case regexp.check(with:, content:) { 55 55 True -> Ok(content) 56 - False -> Error(InvalidFormat(content)) 56 + False -> Error(InvalidSyntax(content)) 57 57 }) 58 58 59 59 use value <- result.map(check_invalid_domains(value))
+1 -1
test/possum_test/did_test.gleam
··· 34 34 ) 35 35 36 36 // invalid identifier syntax 37 - let assert Error(did.InvalidFormat(_)) = 37 + let assert Error(did.InvalidSyntax(_)) = 38 38 list.try_fold( 39 39 [ 40 40 "did:METHOD:val",