mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-08-31 15:09:26 +02:00
22 lines
502 B
Dart
22 lines
502 B
Dart
|
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;
|
||
|
}
|