Exceptions, Errors and asserts in Dart
What’s the difference?
- In Dart an
Exceptionis for an expected bad state that may happen at runtime. Because these exceptions are expected, you should catch them and handle them appropriately.
Error, on the other hand, is for developers who are using your code. You throw an Error to let them know that they are using your code…