From 415e303ac283df8d694b311f4f8df08f6e79cf0e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 16 Apr 2021 06:40:35 +0200 Subject: [pr 2702] finishing the `@StandardException` feature. * rewritten how it works a bit: Now compatible with parent exceptions that don't have the Throwable variants. * rewritten how it works a bit: You can now provide the full constructor only; the rest will forward to it. * fixing up style. * rewrite the docs. --- website/usageExamples/StandardExceptionExample_post.jpage | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'website/usageExamples') diff --git a/website/usageExamples/StandardExceptionExample_post.jpage b/website/usageExamples/StandardExceptionExample_post.jpage index 148603a9..950ca898 100644 --- a/website/usageExamples/StandardExceptionExample_post.jpage +++ b/website/usageExamples/StandardExceptionExample_post.jpage @@ -1,16 +1,18 @@ public class ExampleException extends Exception { public ExampleException() { + this(null, null); } public ExampleException(String message) { - super(message); + this(message, null); } public ExampleException(Throwable cause) { - super(cause); + this(cause != null ? cause.getMessage() : null, cause); } public ExampleException(String message, Throwable cause) { - super(message, cause); + super(message); + if (cause != null) super.initCause(cause); } } \ No newline at end of file -- cgit