-
Notifications
You must be signed in to change notification settings - Fork 356
error message transformer #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PrintWriter printWriter = new PrintWriter(writer); | ||
throwable.printStackTrace(printWriter); | ||
String data = writer.toString(); | ||
byte[] bytes = data.getBytes(Charset.forName("UTF-8")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You can use StandardCharsets.UTF_8
instead of charset lookup.
I am not a big fan of sending stacktraces back to the caller over the network but if you think it is useful 👍 |
StringWriter writer = new StringWriter(); | ||
PrintWriter printWriter = new PrintWriter(writer); | ||
throwable.printStackTrace(printWriter); | ||
String data = writer.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prepend throwable.getMessage() == null ? "" : throwable.getMessage();
to the data
String (sperated by new line) so that in both cases the data starts by the same thing.
👍 |
Closing this in preparation for the latest code push (ref #175) |
Clean up lots of typos and grammar in FAQ
Added a transformer in the Frame.Error class to suck in the whole stack trace and send that as an error message payload optionally.