Dr-Blank.Vaani/lib/models/error_response.dart

22 lines
502 B
Dart
Raw Normal View History

2024-09-06 15:10:00 -04:00
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';
final _logger = Logger('ErrorResponse');
class ErrorResponse {
String? name;
http.Response _response;
ErrorResponse({
this.name,
http.Response? response,
}) : _response = response ?? http.Response('', 418);
void storeError(http.Response response, [Object? error]) {
_logger.warning('for $name got response: $response');
_response = response;
}
http.Response get response => _response;
}