Skip to content

Commit

Permalink
Code improvements - Fix #5 pr comments (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirland authored Aug 29, 2022
1 parent f03c183 commit 4b3df2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/src/extensions/stock_response_internal_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ extension StockResponseExtensions<T> on StockResponse<T> {
} 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',
);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion lib/src/stock_response_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ extension StockResponseExtensions<T> on StockResponse<T> {
} 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',
);
}
}

Expand Down

0 comments on commit 4b3df2f

Please sign in to comment.