Custom exception

suggest change
class CustomException implements Exception {
  String cause;
  CustomException(this.cause);
}

void main() {
  try {
    throwException();
  } on CustomException {
    print("custom exception is been obtained");
  }
}

throwException() {
  throw new CustomException('This is my first custom exception');
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents