Skip to content

Custom error type.#419

Closed
RelicOfTesla wants to merge 2 commits intosamber:masterfrom
RelicOfTesla:master
Closed

Custom error type.#419
RelicOfTesla wants to merge 2 commits intosamber:masterfrom
RelicOfTesla:master

Conversation

@RelicOfTesla
Copy link
Contributor

@RelicOfTesla RelicOfTesla commented Jan 11, 2024

Support user custom error handle in Must() ( like attach the callstack information );
Support MustE("foo", customErr{A: 11, B: 22}) to recover customErr type.

@heww
Copy link

heww commented Jan 29, 2024

Hi, could someone take a look at this MR? The MustX function will lose the original error.

@RelicOfTesla
Copy link
Contributor Author

Hi, could someone take a look at this MR? The MustX function will lose the original error.

Can you give me a example code ?

@heww
Copy link

heww commented Jan 29, 2024

Hi, could someone take a look at this MR? The MustX function will lose the original error.

Can you give me a example code ?

The MuxtX means the Must and Must{0->6}, here is an example I can't restore the original error. https://goplay.space/#k1qNcdql4Uz

I like the MustE in this MR.

@RelicOfTesla
Copy link
Contributor Author

Haha, this is right. I misunderstood your meaning.

@samber
Copy link
Owner

samber commented Jan 28, 2025

Can you give an example of how these helpers would be used?

I don't see in what context it could be useful. But I might be wrong.

@RelicOfTesla
Copy link
Contributor Author

Can you give an example of how these helpers would be used?

I don't see in what context it could be useful. But I might be wrong.

You can see the "TestErrorWrapUnWrap" and "TestErrorGlobalErrHandler" func

@RelicOfTesla RelicOfTesla deleted the branch samber:master December 10, 2025 13:21
@RelicOfTesla RelicOfTesla deleted the master branch December 10, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants