diff --git a/Sources/dafl_project_flutter/lib/exceptions/http_exception.dart b/Sources/dafl_project_flutter/lib/exceptions/http_exception.dart index f2f6888..bdcc0e6 100644 --- a/Sources/dafl_project_flutter/lib/exceptions/http_exception.dart +++ b/Sources/dafl_project_flutter/lib/exceptions/http_exception.dart @@ -1,9 +1,12 @@ import 'dart:developer' as dev; +import 'package:http/http.dart'; class HttpException implements Exception { HttpException(var value) { - dev.log('Http request failed :'); - dev.log('Status code : ${value.statusCode.toString()}'); - dev.log('Body : ${value.body.toString()}'); + dev.log('Http request failed'); + if (value.runtimeType == Response) { + dev.log('Status code : ${value.statusCode.toString()}'); + dev.log('Body : ${value.body.toString()}'); + } } -} +} \ No newline at end of file