From 5920212d04f569e240b47645433dce612b3a1d0d Mon Sep 17 00:00:00 2001 From: thomashii Date: Wed, 10 Mar 2021 00:41:42 +0800 Subject: [PATCH] Migrated angel_http_exception to nnbd --- packages/http_exception/lib/angel_http_exception.dart | 8 ++++---- packages/http_exception/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/http_exception/lib/angel_http_exception.dart b/packages/http_exception/lib/angel_http_exception.dart index f15ebafc..b38d854e 100644 --- a/packages/http_exception/lib/angel_http_exception.dart +++ b/packages/http_exception/lib/angel_http_exception.dart @@ -15,13 +15,13 @@ class AngelHttpException implements Exception { final List errors = []; /// The cause of this exception. - String message; + String? message; /// The [StackTrace] associated with this error. - StackTrace stackTrace; + StackTrace? stackTrace; /// An HTTP status code this exception will throw. - int statusCode; + int? statusCode; AngelHttpException(this.error, {this.message = '500 Internal Server Error', @@ -52,7 +52,7 @@ class AngelHttpException implements Exception { factory AngelHttpException.fromMap(Map data) { return AngelHttpException( null, - statusCode: (data['status_code'] ?? data['statusCode']) as int, + statusCode: (data['status_code'] ?? data['statusCode']) as int?, message: data['message']?.toString(), errors: data['errors'] is Iterable ? ((data['errors'] as Iterable).map((x) => x.toString()).toList()) diff --git a/packages/http_exception/pubspec.yaml b/packages/http_exception/pubspec.yaml index 6a4de47a..ea88a684 100644 --- a/packages/http_exception/pubspec.yaml +++ b/packages/http_exception/pubspec.yaml @@ -1,9 +1,9 @@ name: angel_http_exception -version: 2.0.0 +version: 2.1.0 description: Exception class that can be serialized to JSON and serialized to clients. #author: Tobe O homepage: https://github.com/dukefirehawk/angel/packages/http_exception environment: - sdk: ">=2.10.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' dev_dependencies: pedantic: ^1.11.0 \ No newline at end of file