Extra debugging to try and save error pages for the various types of bidding errors.
| 914 | 947 | |
|---|---|---|
| 45 | 45 | */ |
| 46 | 46 | if(mResultHash == null) { |
| 47 | 47 | mResultHash = new HashMap<String, Integer>(); |
| 48 | mResultHash.put("you('re| are) not permitted to bid on their listings.", AuctionServer.BID_ERROR_BANNED); | |
| 48 | mResultHash.put("you('re| are) not permitted to bid on their listings.", AuctionServer.BID_ERROR_BANNED); /**/ | |
| 49 | 49 | mResultHash.put("the item is no longer available because the auction has ended.", AuctionServer.BID_ERROR_ENDED); |
| 50 | 50 | mResultHash.put("bidding has ended (for|on) this item", AuctionServer.BID_ERROR_ENDED); |
| 51 | 51 | mResultHash.put("cannot proceed", AuctionServer.BID_ERROR_CANNOT); |
| 52 | 52 | mResultHash.put("problem with bid amount", AuctionServer.BID_ERROR_AMOUNT); |
| 53 | mResultHash.put("your bid must be at least ", AuctionServer.BID_ERROR_TOO_LOW); | |
| 53 | mResultHash.put("your bid must be at least ", AuctionServer.BID_ERROR_TOO_LOW); /*?*/ | |
| 54 | 54 | mResultHash.put("you('ve| have) been outbid by another bidder", AuctionServer.BID_ERROR_OUTBID); |
| 55 | 55 | mResultHash.put("you('ve| have) just been outbid", ebayServer.BID_ERROR_OUTBID); |
| 56 | 56 | mResultHash.put("your bid is confirmed!", AuctionServer.BID_DUTCH_CONFIRMED); |
| --- | --- | |
| 59 | 59 | mResultHash.put("you('re| are) the current high bidder", AuctionServer.BID_WINNING); |
| 60 | 60 | mResultHash.put("you('re| are) the first bidder", AuctionServer.BID_WINNING); |
| 61 | 61 | mResultHash.put("you('re| are) the high bidder and currently in the lead", AuctionServer.BID_WINNING); |
| 62 | mResultHash.put("you('re| are) currently the highest bidder", AuctionServer.BID_WINNING); | |
| 62 | mResultHash.put("you('re| are) currently the highest bidder", AuctionServer.BID_WINNING); /**/ | |
| 63 | 63 | mResultHash.put("you purchased the item", AuctionServer.BID_WINNING); |
| 64 | 64 | mResultHash.put("you('re| are) currently the high bidder, but the reserve hasn.t been met", AuctionServer.BID_ERROR_RESERVE_NOT_MET); |
| 65 | 65 | mResultHash.put("the reserve price has not been met", AuctionServer.BID_ERROR_RESERVE_NOT_MET); |
| --- | --- | |
| 133 | 133 | |
| 134 | 134 | if(rval.getDocument() != null) { |
| 135 | 135 | checkSignOn(rval.getDocument()); |
| 136 | checkBidErrors(rval.getDocument()); | |
| 136 | checkBidErrors(rval); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if(JConfig.queryConfiguration("my.jbidwatcher.enabled", "false").equals("true") && |
| --- | --- | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | if(JConfig.debugging) inEntry.setLastStatus("Failed to bid. 'Show Last Error' from context menu to see the failure page from the bid attempt."); |
| 156 | JConfig.log().dump2File("unknown-" + inEntry.getIdentifier() + ".html", rval.getBuffer()); | |
| 156 | 157 | inEntry.setErrorPage(rval.getBuffer()); |
| 157 | 158 | |
| 158 | 159 | // We don't recognize this error. Damn. Log it and freak. |
| --- | --- | |
| 236 | 237 | return new BidFormReturn(false, null, htmlDocument, loadedPage); |
| 237 | 238 | } |
| 238 | 239 | |
| 239 | private void checkBidErrors(JHTML htmlDocument) throws BadBidException { | |
| 240 | private void checkBidErrors(BidFormReturn inVal) throws BadBidException { | |
| 241 | JHTML htmlDocument = inVal.getDocument(); | |
| 240 | 242 | String errMsg = htmlDocument.grep(mBidResultRegex); |
| 241 | 243 | if(errMsg != null) { |
| 242 | 244 | Matcher bidMatch = mFindBidResult.matcher(errMsg); |
| 243 | 245 | bidMatch.find(); |
| 244 | 246 | String matched_error = bidMatch.group().toLowerCase(); |
| 245 | throw new BadBidException(matched_error, getMatchedResult(matched_error)); | |
| 247 | Integer result = getMatchedResult(matched_error); | |
| 248 | JConfig.log().dump2File("error-" + result + ".html", inVal.getBuffer()); | |
| 249 | ||
| 250 | throw new BadBidException(matched_error, result); | |
| 246 | 251 | } else { |
| 247 | 252 | String amount = htmlDocument.getNextContentAfterRegex("\\s*Enter\\s*"); |
| 248 | 253 | if (amount != null) { |
| 249 | 254 | String orMore = htmlDocument.getNextContent(); |
| 250 | 255 | if (orMore != null && orMore.indexOf("or more") != -1) { |
| 256 | JConfig.log().dump2File("error-" + ebayServer.BID_ERROR_TOO_LOW + ".html", inVal.getBuffer()); | |
| 251 | 257 | throw new BadBidException("Enter " + amount + orMore, ebayServer.BID_ERROR_TOO_LOW); |
| 252 | 258 | } |
| 253 | 259 | } |
| --- | --- | |
| 382 | 388 | bidMatch.find(); |
| 383 | 389 | String matched_error = bidMatch.group().toLowerCase(); |
| 384 | 390 | Integer bidResult = getMatchedResult(matched_error); |
| 391 | JConfig.log().dump2File("error-" + bidResult + ".html", loadedPage); | |
| 385 | 392 | |
| 386 | 393 | int result = 0; |
| 387 | 394 | if (bidResult != null) { |
| --- | --- | |
| 418 | 425 | } |
| 419 | 426 | |
| 420 | 427 | if(JConfig.debugging) inEntry.setLastStatus("Failed to load post-bid data. 'Show Last Error' from context menu to see the failure page from the post-bid page."); |
| 428 | JConfig.log().dump2File("unknown-" + inEntry.getIdentifier() + ".html", loadedPage); | |
| 421 | 429 | inEntry.setErrorPage(loadedPage); |
| 422 | 430 | |
| 423 | 431 | JConfig.log().logFile(safeBidInfo, loadedPage); |
