Skip to content

Unwrap joinErr in gin.Error() #4237

Open
@slhmy

Description

@slhmy

In go errors pkg can create a joinErr by errors.Join(), which can be Unwrap() into []error.
joinErr also format it's print into \n separated string, which is similar with gin.errorMsgs.String() but can cause confuse, when they are used together:

Error #01 gin error
Error #02 service error
store error
Error #03 other error

In this case service error & store error is combined with a joinErr.
I think it will be better if we can see:

Error #01 gin error
Error #02 service error
Error #03 store error
Error #04 other error

Even though we can unwrap joinErr before we use gin.Error(), it will be better if gin.Error() do the unwrap for us as a internal logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions