Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Dart Try Catch Exception Line Number

Tags:

flutter

dart

how can i know the line number of the caught Exception inside try, catch ? here is my code:

try{
//your code here
} catch (Exception) {
    print('Exception '+Exception.toString());

  }
like image 994
Mohammed Ali Avatar asked Aug 27 '19 09:08

Mohammed Ali


1 Answers

try{
//your code here
} catch (e, stacktrace) {
    print('Exception: ' + e.toString());
    print('Stacktrace: ' + stacktrace.toString());
}
like image 85
xTech Avatar answered Sep 22 '22 17:09

xTech