isInventoryError function

bool isInventoryError(
  1. Object? error, [
  2. String? code
])

Kurzform fuer on Object catch (e) { if (isInventoryError(e, 'article_not_found')) … }; ohne code jeder Code der Lager-API.

Implementation

bool isInventoryError(Object? error, [String? code]) {
  final gefunden = inventoryErrorCode(error);
  return gefunden != null && (code == null || gefunden == code);
}