Migrated angel_http_exception to nnbd

This commit is contained in:
thomashii 2021-03-10 00:41:42 +08:00
parent 1db6b35fb3
commit 5920212d04
2 changed files with 6 additions and 6 deletions

View file

@ -15,13 +15,13 @@ class AngelHttpException implements Exception {
final List<String> errors = []; final List<String> errors = [];
/// The cause of this exception. /// The cause of this exception.
String message; String? message;
/// The [StackTrace] associated with this error. /// The [StackTrace] associated with this error.
StackTrace stackTrace; StackTrace? stackTrace;
/// An HTTP status code this exception will throw. /// An HTTP status code this exception will throw.
int statusCode; int? statusCode;
AngelHttpException(this.error, AngelHttpException(this.error,
{this.message = '500 Internal Server Error', {this.message = '500 Internal Server Error',
@ -52,7 +52,7 @@ class AngelHttpException implements Exception {
factory AngelHttpException.fromMap(Map data) { factory AngelHttpException.fromMap(Map data) {
return AngelHttpException( return AngelHttpException(
null, null,
statusCode: (data['status_code'] ?? data['statusCode']) as int, statusCode: (data['status_code'] ?? data['statusCode']) as int?,
message: data['message']?.toString(), message: data['message']?.toString(),
errors: data['errors'] is Iterable errors: data['errors'] is Iterable
? ((data['errors'] as Iterable).map((x) => x.toString()).toList()) ? ((data['errors'] as Iterable).map((x) => x.toString()).toList())

View file

@ -1,9 +1,9 @@
name: angel_http_exception 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. description: Exception class that can be serialized to JSON and serialized to clients.
#author: Tobe O <thosakwe@gmail.com> #author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/dukefirehawk/angel/packages/http_exception homepage: https://github.com/dukefirehawk/angel/packages/http_exception
environment: environment:
sdk: ">=2.10.0 <3.0.0" sdk: '>=2.12.0 <3.0.0'
dev_dependencies: dev_dependencies:
pedantic: ^1.11.0 pedantic: ^1.11.0