All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dart2-v3template.api_exception.mustache Maven / Gradle / Ivy

Go to download

dart2 generator from openapi 3.x spec files. Changing to openapitools dependencies.

The newest version!
part of {{pubName}}.api;

class ApiException implements Exception {
  int code = 0;
  String message;
  Exception innerException;
  StackTrace stackTrace;

  ApiException(this.code, this.message);

  ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);

  String toString() {
    if (message == null) return "ApiException";

    if (innerException == null) {
      return "ApiException $code: $message";
    }

    return "ApiException $code: $message (Inner exception: $innerException)\n\n" +
        stackTrace.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy