ulid-docs: format errors with $errors

freebsd-work
Alexander Iljin 2019-01-02 09:49:30 +01:00 committed by John Benediktsson
parent 184b614e89
commit 6105055b82
1 changed files with 6 additions and 8 deletions

View File

@ -20,10 +20,8 @@ HELP: bytes>ulid
{ "byte-array" byte-array } { "byte-array" byte-array }
{ "ulid" string } { "ulid" string }
} }
{ $description "Convert a binary ULID to its string representation using the Crockford's base32 " { $link encoding } ". The " { $snippet "byte-array" } " must be exactly 16 bytes long, the resulting " { $snippet "ulid" } " string is always 26 characters long." { $description "Convert a binary ULID to its string representation using the Crockford's base32 " { $link encoding } ". The " { $snippet "byte-array" } " must be exactly 16 bytes long, the resulting " { $snippet "ulid" } " string is always 26 characters long." }
$nl { $errors { $subsections bytes>ulid-bad-length } } ;
"The following errors may be thrown during the conversion:"
{ $subsections bytes>ulid-bad-length } } ;
HELP: bytes>ulid-bad-length HELP: bytes>ulid-bad-length
{ $values { $values
@ -45,9 +43,8 @@ HELP: ulid
} }
{ $description "Generate a new 128-bit ULID using and return its string representation in the Crockford's base32 " { $link encoding } ". The current system time is encoded in the high 48 bits as the Unix time in milliseconds, the low 80 bits are random." { $description "Generate a new 128-bit ULID using and return its string representation in the Crockford's base32 " { $link encoding } ". The current system time is encoded in the high 48 bits as the Unix time in milliseconds, the low 80 bits are random."
$nl $nl
"At the time of this writing the Factor implementation is not able to produce multiple ULIDs within less than one millisecond of each other, but a provision is made to make sure that if that ever happens in the future, the subsequent ULIDs inside of a millisecond will be an increment of the previous ones to guarentee the sorting order of the identifiers, as per the specification." "At the time of this writing the Factor implementation is not able to produce multiple ULIDs within less than one millisecond of each other, but a provision is made to make sure that if that ever happens in the future, the subsequent ULIDs inside of a millisecond will be an increment of the previous ones to guarentee the sorting order of the identifiers, as per the specification." }
$nl { $errors "In case an overflow happens during such incrementing, the " { $link ulid-overflow } " error will be thrown." } ;
"In case an overflow happens during such incrementing, the " { $link ulid-overflow } " error will be thrown." } ;
HELP: ulid-overflow HELP: ulid-overflow
{ $description "Throws an " { $link ulid-overflow } " error." } { $description "Throws an " { $link ulid-overflow } " error." }
@ -58,7 +55,8 @@ HELP: ulid>bytes
{ "ulid" string } { "ulid" string }
{ "byte-array" byte-array } { "byte-array" byte-array }
} }
{ $description "Convert a string " { $snippet "ulid" } " into its binary representation. Some errors may be thrown in the process:" { $subsections ulid>bytes-bad-length ulid>bytes-bad-character ulid>bytes-overflow } } ; { $description "Convert a string " { $snippet "ulid" } " into its binary representation." }
{ $errors { $subsections ulid>bytes-bad-length ulid>bytes-bad-character ulid>bytes-overflow } } ;
HELP: ulid>bytes-bad-character HELP: ulid>bytes-bad-character
{ $values { $values