Documentation
¶
Index ¶
- func StreamServerInterceptor(funcs ...ErrorHandlerFunc) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(funcs ...ErrorHandlerFunc) grpc.UnaryServerInterceptor
- type AppErrorHandlerFunc
- type ErrorHandlerFunc
- func WithAppErrorHandler(f AppErrorHandlerFunc) ErrorHandlerFunc
- func WithNotWrappedErrorHandler(f ErrorHandlerFunc) ErrorHandlerFunc
- func WithReportableErrorHandler(f AppErrorHandlerFunc) ErrorHandlerFunc
- func WithStatusCodeMap(m map[int]codes.Code) ErrorHandlerFunc
- func WithStatusCodeMapper(mapFn func(code int) codes.Code) ErrorHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(funcs ...ErrorHandlerFunc) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor to handle errors
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(funcs ...ErrorHandlerFunc) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor to handle errors
Types ¶
type AppErrorHandlerFunc ¶
AppErrorHandlerFunc is a function that called by interceptors when specified application erorrs are detected.
type ErrorHandlerFunc ¶
ErrorHandlerFunc is a function that called by interceptors when specified erorrs are detected.
func WithAppErrorHandler ¶ added in v0.2.0
func WithAppErrorHandler(f AppErrorHandlerFunc) ErrorHandlerFunc
WithAppErrorHandler returns a new error handler function for handling errors wrapped with apperrors.
func WithNotWrappedErrorHandler ¶
func WithNotWrappedErrorHandler(f ErrorHandlerFunc) ErrorHandlerFunc
WithNotWrappedErrorHandler returns a new error handler function for handling not wrapped errors.
func WithReportableErrorHandler ¶
func WithReportableErrorHandler(f AppErrorHandlerFunc) ErrorHandlerFunc
WithReportableErrorHandler returns a new error handler function for handling errors annotated with the reportability.
func WithStatusCodeMap ¶ added in v0.2.0
func WithStatusCodeMap(m map[int]codes.Code) ErrorHandlerFunc
WithStatusCodeMap returns a new error handler function for mapping status codes to gRPC's one.
func WithStatusCodeMapper ¶
func WithStatusCodeMapper(mapFn func(code int) codes.Code) ErrorHandlerFunc
WithStatusCodeMapper returns a new error handler function for mapping status codes to gRPC's one with given function.