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
|
# 1.0.0+2
|
||||||
* Added a backwards-compatible way to cast the `errors` List.
|
* 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,
|
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<String>
|
errors: data['errors'] is Iterable
|
||||||
? ((data['errors'] as Iterable<String>).toList())
|
? ((data['errors'] as Iterable).map((x) => x.toString()).toList())
|
||||||
: <String>[],
|
: <String>[],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel_http_exception
|
name: angel_http_exception
|
||||||
version: 1.0.0+2
|
version: 1.0.0+3
|
||||||
description: Angel's HTTP exception class.
|
description: Angel's HTTP exception class.
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/http_exception
|
homepage: https://github.com/angel-dart/http_exception
|
||||||
|
|
Loading…
Reference in a new issue