hertz-examples icon indicating copy to clipboard operation
hertz-examples copied to clipboard

In the example:middleware/csrf/custom_errorfunc/main.go,the function myErrFunc does not implement what the author wants.

Open Tracy-coder opened this issue 1 year ago • 1 comments

In the example:middleware/csrf/custom_errorfunc/main.go,the function myErrFunc does not implement what the author wants. https://github.com/cloudwego/hertz-examples/blob/231bdf80c234de47a79b312326a8dd6a0e74de2b/middleware/csrf/custom_errorfunc/main.go#L32-L40 https://github.com/cloudwego/hertz-examples/blob/231bdf80c234de47a79b312326a8dd6a0e74de2b/middleware/csrf/custom_errorfunc/main.go#L42-L54

The switch statement can't be used for error handling in this way, which may be misleading for those reading this example.

Tracy-coder avatar Jul 13 '24 08:07 Tracy-coder

Thanks for the reminder.

Claude-Zq avatar Jul 29 '24 03:07 Claude-Zq