From 4b3df2fca34c7ac75d2c4cf217bd725668150551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Irland?= Date: Mon, 29 Aug 2022 12:39:19 -0300 Subject: [PATCH] Code improvements - Fix #5 pr comments (#11) --- lib/src/extensions/stock_response_internal_extensions.dart | 4 +++- lib/src/stock_response_extensions.dart | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/extensions/stock_response_internal_extensions.dart b/lib/src/extensions/stock_response_internal_extensions.dart index c9e0ada..235eb35 100644 --- a/lib/src/extensions/stock_response_internal_extensions.dart +++ b/lib/src/extensions/stock_response_internal_extensions.dart @@ -16,7 +16,9 @@ extension StockResponseExtensions on StockResponse { } else if (isLoading) { return StockResponse.loading(origin); } else { - throw StockError('Unknown type'); + throw StockError( + 'Type error swapType expect either Success, Error or Loading but was given $runtimeType', + ); } } } diff --git a/lib/src/stock_response_extensions.dart b/lib/src/stock_response_extensions.dart index e50b9ab..fb28a78 100644 --- a/lib/src/stock_response_extensions.dart +++ b/lib/src/stock_response_extensions.dart @@ -11,7 +11,9 @@ extension StockResponseExtensions on StockResponse { } else if (isLoading) { throw StockError('There is no data in loading'); } else { - throw StockError('Unknown type'); + throw StockError( + 'Type error requireData expect either Success, Error but was given $runtimeType', + ); } }