/// Exception thrown by the {{language.params.packageName}} package.
class {{spec.title | caseUcfirst}}Exception implements Exception {
  /// Error message.
  final String? message;

  /// Error type.
  ///
  /// See [Error Types]({{sdk.url}}/docs/response-codes#errorTypes)
  /// for more information.
  final String? type;
  final int? code;
  final dynamic response;

  /// Initializes an {{spec.title | caseUcfirst}} Exception.
  {{spec.title | caseUcfirst}}Exception([this.message = "", this.code, this.type, this.response]);
  
  /// Returns the error type, message, and code.
  @override
  String toString() {
    if (message == null || message == "") return "{{spec.title | caseUcfirst}}Exception";
    return "{{spec.title | caseUcfirst}}Exception: ${type ?? ''}, $message (${code ?? 0})";
  }
}
