go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

gozero rpc error print

Open lynnzhang89 opened this issue 2 years ago • 4 comments

hi, i have a logic code in rpc service below: image

i use grpc error to pass error to api service to indicate error info.

but gozero interceptor will print error in https://github.com/zeromicro/go-zero/blob/master/zrpc/internal/clientinterceptors/durationinterceptor.go like below: image

error like Invalid Argument should not print error log while this error is caused by user input. and duration interceptor is used to print slow call error log, grpc error print should not put in it.

so i suggest if it is possible to remove error log print in duration interceptor?

lynnzhang89 avatar Nov 29 '22 05:11 lynnzhang89

https://github.com/zeromicro/go-zero/issues/1886 You can refer to this to filter out

Mikaelemmmm avatar Dec 02 '22 03:12 Mikaelemmmm

I think filtering through string matching, it will waste CPU resources. Why not add an option to the log output at this location?

foliet avatar Dec 13 '22 15:12 foliet

Customizing error codes in business should be a common behavior, right?

foliet avatar Dec 13 '22 16:12 foliet

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 14 '23 01:12 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Mar 28 '24 01:03 github-actions[bot]