Patch +3
This commit is contained in:
parent
d60bc4faf2
commit
c025992f47
4 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
|||
# 1.0.0+3
|
||||
* Slightly relax the deserialization of `errors`.
|
||||
|
||||
# 1.0.0+2
|
||||
* Added a backwards-compatible way to cast the `errors` List.
|
||||
|
||||
|
|
4
example/main.dart
Normal file
4
example/main.dart
Normal file
|
@ -0,0 +1,4 @@
|
|||
import 'package:angel_http_exception/angel_http_exception.dart';
|
||||
|
||||
void main() =>
|
||||
throw new AngelHttpException.notFound(message: "Can't find that page!");
|
|
@ -50,8 +50,8 @@ class AngelHttpException implements Exception {
|
|||
null,
|
||||
statusCode: (data['status_code'] ?? data['statusCode']) as int,
|
||||
message: data['message']?.toString(),
|
||||
errors: data['errors'] is Iterable<String>
|
||||
? ((data['errors'] as Iterable<String>).toList())
|
||||
errors: data['errors'] is Iterable
|
||||
? ((data['errors'] as Iterable).map((x) => x.toString()).toList())
|
||||
: <String>[],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel_http_exception
|
||||
version: 1.0.0+2
|
||||
version: 1.0.0+3
|
||||
description: Angel's HTTP exception class.
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
homepage: https://github.com/angel-dart/http_exception
|
||||
|
|
Loading…
Reference in a new issue