Interface Hooks
public interface Hooks
Callbacks invoked for every HTTP attempt (SPEC section 2.5). URLs and headers are redacted.
Exceptions thrown by a hook are caught and ignored.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordData passed toonError(codes.grow.packages.betterstack.core.Hooks.ErrorInfo).static final recordstatic final record -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidonError(Hooks.ErrorInfo info) Called when an attempt failed (network error, timeout or error status).default voidonRequest(Hooks.RequestInfo info) Called before each attempt.default voidonResponse(Hooks.ResponseInfo info) Called when an attempt received a response (any status).
-
Field Details
-
NONE
Hooks that do nothing.
-
-
Method Details
-
onRequest
Called before each attempt.- Parameters:
info- request data
-
onResponse
Called when an attempt received a response (any status).- Parameters:
info- response data
-
onError
Called when an attempt failed (network error, timeout or error status).- Parameters:
info- error data
-