errorMessageOrNull method

String? errorMessageOrNull()

If this StoreResponse is of type ErrorStoreResponse, returns the available error from it. Otherwise, returns null.

Implementation

String? errorMessageOrNull() {
  if (this is ErrorMessageStoreResponse) {
    return (this as ErrorMessageStoreResponse).message;
  } else if (this is ExceptionStoreResponse) {
    return (this as ExceptionStoreResponse).error.toString();
  }
}