chiark / gitweb /
pctb upload: Print and throw an error if there are no offers
[jarrg-ian.git] / src / com / tedpearson / ypp / market / MarketUploader.java
index daafc10b8b10a248fae00a7ad507e2dbf56e6902..715e847b895eac70e691b0fce699ea256b01edc0 100644 (file)
@@ -664,9 +664,13 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                                        buySellCount[1]++;
                                }
                        } catch(IllegalArgumentException e) {
-                               // System.err.println("Error: Unsupported Commodity \"" + offer.get(0) + "\"");
+                               System.err.println("Error: Unsupported Commodity \"" + offer.get(0) + "\"");
                        }
                }
+               if (buySellCount[0]==0 && buySellCount[1]==0) {
+                   error("No (valid) offers for PCTB?!");
+                   throw new IllegalArgumentException();
+               }
                return buySellCount;
        }