Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Implements custom proxy error handler#18

Merged
mjallday merged 5 commits into
verygoodsecurity:vgs-editionfrom
viacheslav-fomin-main:feature/proxy-to-server-ex-handler
Jun 21, 2017
Merged

Implements custom proxy error handler#18
mjallday merged 5 commits into
verygoodsecurity:vgs-editionfrom
viacheslav-fomin-main:feature/proxy-to-server-ex-handler

Conversation

@viacheslav-fomin-main
Copy link
Copy Markdown
Collaborator

@viacheslav-fomin-main viacheslav-fomin-main commented Jun 19, 2017

Fixes: https://github.com/verygoodsecurity/vault/issues/1480

WITH THIS IMPLEMENTATION WE WILL BE ABLE TO HANDLE THESE TYPES OF ERRORS: https://rollbar.com/VeryGood/VGS-Vault/items/1076/occurrences/26139703957/

Pipeline consists of handlers, in our case they are ClientToProxyConnection and ProxyToServerConnection and a handler can override exceptionCaught method which handles an error that is thrown somewhere during processing.

The error will be passed down the pipeline until it finds a handler that overrides the method. So I intervened with custom handler that will handle the error from within the exceptionCaught method.

@viacheslav-fomin-main viacheslav-fomin-main changed the title Implements custom proxy to server error handler Implements custom proxy error handler Jun 20, 2017
Copy link
Copy Markdown

@mjallday mjallday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good but it's breaking the interface so we need to bump the major version number.

LOG.error("Caught an exception on ClientToProxyConnection", cause);
ExceptionHandler exHandler = proxyServer.getClientToProxyExHandler();
if (exHandler != null) {
LOG.debug("Custom exception handler is used to process the cause");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please log the handler so it's easier to debug e.g. LOG.debug("Custom exception handler '" + ex.toString() + "' invoked", cause);

@viacheslav-fomin-main
Copy link
Copy Markdown
Collaborator Author

@mjallday addressed your comments

@mjallday mjallday merged commit ee36707 into verygoodsecurity:vgs-edition Jun 21, 2017
@viacheslav-fomin-main viacheslav-fomin-main self-assigned this Jun 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants