Try catch not working #2071
-
I turned off the server so i can implement basic error handling but i can't seem to catch the error. I tried try {
final response = await dio.post(s.uploadUrl(), data: formData);
if (response.statusCode == 200) {
debugPrint("Uploaded successfully!!!");
}
} catch (e) {
debugPrint("Upload Error!!! ${e.toString()}");
} try {
final response = await dio.post(s.uploadUrl(), data: formData);
if (response.statusCode == 200) {
debugPrint("Uploaded successfully!!!");
}
} on Exception catch (e) {
debugPrint("Upload Error!!! ${e.toString()}");
} try {
final response = await dio.post(s.uploadUrl(), data: formData);
if (response.statusCode == 200) {
debugPrint("Uploaded successfully!!!");
}
} on DioException catch (e) {
debugPrint("Upload Error!!! ${e.toString()}");
} |
Beta Was this translation helpful? Give feedback.
Answered by
AlexV525
Dec 20, 2023
Replies: 1 comment 8 replies
-
any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you uncheck "uncaught exception" in your VS Code debugger setting? See #1869