forked from loafle/openapi-generator-original
Java: Add toString
method to ApiException (#12851)
Previously, only the class name appeared in stacktrace whereas now relevant details are added. This applies to most Java-related generators.
This commit is contained in:
parent
cb462851b5
commit
bf604a08ab
@ -77,4 +77,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us
|
|||||||
public String getResponseBody() {
|
public String getResponseBody() {
|
||||||
return responseBody;
|
return responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", responseHeaders=" + responseHeaders +
|
||||||
|
", responseBody='" + responseBody + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package {{apiPackage}};
|
|||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package {{apiPackage}};
|
|||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import javax.annotation.Generated;
|
|||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -36,4 +35,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,4 +27,12 @@ public class ApiException extends Exception {
|
|||||||
public void setMessage(String message) {
|
public void setMessage(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message=" + message +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,4 +47,12 @@ public class ApiException extends Exception {
|
|||||||
public void setMessage(String message) {
|
public void setMessage(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message=" + message +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package {{apiPackage}};
|
|||||||
*/
|
*/
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,13 @@ public class ApiException extends Exception {
|
|||||||
public String getResponseBody() {
|
public String getResponseBody() {
|
||||||
return responseBody;
|
return responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", responseHeaders=" + responseHeaders +
|
||||||
|
", responseBody='" + responseBody + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,13 @@ public class ApiException extends Exception {
|
|||||||
public String getResponseBody() {
|
public String getResponseBody() {
|
||||||
return responseBody;
|
return responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", responseHeaders=" + responseHeaders +
|
||||||
|
", responseBody='" + responseBody + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,4 +88,13 @@ public class ApiException extends Exception {
|
|||||||
public String getResponseBody() {
|
public String getResponseBody() {
|
||||||
return responseBody;
|
return responseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
", responseHeaders=" + responseHeaders +
|
||||||
|
", responseBody='" + responseBody + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaResteasyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package org.openapitools.api;
|
|||||||
*/
|
*/
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen")
|
||||||
public class ApiException extends Exception {
|
public class ApiException extends Exception {
|
||||||
|
|
||||||
/** The HTTP status code. */
|
/** The HTTP status code. */
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
@ -29,4 +28,10 @@ public class ApiException extends Exception {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ApiException{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user