Closed plusiv closed 1 month ago
Hi @bormanp , I really appreciate your review and valid suggestions. I've removed some changes that were added unintentionally by my code formatter in my code editor. Additionally I've sightly modified the approach with ErrInvalidLength
and ErrInvalidURNPrefix
error types to keep more backward compatibility.
Description:
This PR improves error handling by adding specific error types and ensuring compatibility with
errors.Is
for better validation. The changes include:ErrInvalidUUIDFormat
ErrInvalidURNPrefix
ErrInvalidBracketedFormat
ErrInvalidLength
Parse
,ParseBytes
, andValidate
functions to wrap errors with additional context usingfmt.Errorf
and%w
.IsInvalidLengthError
function.