What is result when the ResumeBookmark gets a timeout? - workflow-foundation-4

I'm trying to check the result in the MSDM when the resuming bookmark gets a timeout, and I couldn't find a clear answer.
http://msdn.microsoft.com/en-us/library/ee149798.aspx
BookmarkResumptionResult rtv = workflowApplication.ResumeBookmark(bookmarkName, value, bookmarkResumptionTimeout);
Should it be NotFound or NotReady?
Thanks!

I was unable to find documentation but looking into reflector System.TimeoutException will be thrown.

Related

Blocking get aio_pika

I expected
await queue.get()
to be blocking in aio_pika, but even when I don't set the timeout parameter I instantly get an error:
aio_pika.exceptions.QueueEmpty
Anyway to get a blocking get in aio_pika?
EDIT:
This is the best I could come up with so far.
while True:
msg = await q.get(fail=False)
if msg:
break
await asyncio.sleep(1)
The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
You should use a very long timeout, according to the documentation for that method. There does not appear to be another way to do it.

What is causing the exception HRESULT: 0xC0C01B22 when attempting to enlist a send port with a filter?

This is a simple send port, in which I'm trying to setup a filter over a promoted property. Whenever I attempt to enlist this port, I get the following error:
===================================
Could not update Send Port 'SendPort1' in Message Box. Exception from HRESULT: 0xC0C01B22 (Microsoft.BizTalk.ExplorerOM)
------------------------------
For help, click: http://go.microsoft.com/fwlink/?LinkId=47400&ProdName=Microsoft+BizTalk+Server+2013&ProdVer=3.10.229.0&EvtSrc=Microsoft.BizTalk.ExplorerOM.Resources&EvtID=IDS_ERR_SENDPORT_UPDATE
------------------------------
Program Location:
at Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer.SaveChangesWithTransaction(Object transactionObj)
at Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer.SaveChanges()
at Microsoft.BizTalk.Administration.SnapIn.Forms.Common.ExplorerPropertyPagesContainer.CommitChanges()
at Microsoft.BizTalk.SnapIn.Framework.Forms.PropertyPagesContainer.Store()
at Microsoft.BizTalk.SnapIn.Framework.Forms.SheetFramework.Store()
The filter simply checks for existence of the promoted property in the incoming message. There's only one post in MSDN forums about this exception: HRESULT 0xC0C01B22
Any idea what is causing this?
The answer is in this page: https://learn.microsoft.com/en-us/biztalk/core/promoting-properties
The note there says the following:
XSD Data Type of base64Binary, duration, ENTITES, hexBinary, IDREFS, long, NMTOKENS, and unsignedLong are not supported for promotion.
Turns out, in our case, the promoted property is of xs:long type. I changed the element type to xs:string then the issue in the question went away.
It would make sense to prevent the promotion of the elements if they are of unsupported type, in the beginning itself. But we don't get to see any alerts during the promotion phase for such elements.
Hope this helps someone.

how to force scrapy exit when there is an exception

I wrote a crawler with Scrapy.
There is a function in the pipeline where I write my data to a database. I use the logging module to log runtime logs.
I found that when my string have Chinese logging.error() will throw an exception. But the crawler keeps running!
I know this is a minor error but if there is a critical exception I will miss it if crawler keeps running.
My question is: Is there a setting that I can force Scrapy stop when there is an exception?
You can use CLOSESPIDER_ERRORCOUNT
An integer which specifies the maximum number of errors to receive
before closing the spider. If the spider generates more than that
number of errors, it will be closed with the reason
closespider_errorcount. If zero (or non set), spiders won’t be closed
by number of errors.
By default it is set to 0
CLOSESPIDER_ERRORCOUNT = 0
you can change it to 1 if you want to exit when you have the first error.
UPDATE
Read the answers of this question, you can also use:
crawler.engine.close_spider(self, 'log message')
for more information read :
Close spider extension
In the process_item function of your spider you have an instance of spider.
To solve your problem you could catch the exceptions when you insert your data, then neatly stop you spider if you catch a certain exeption like this:
def process_item(self, item, spider):
try:
#Insert your item here
except YourExceptionName:
spider.crawler.engine.close_spider(self, reason='finished')
I don't know of a setting that would close the crawler on any exception, but you have at least a couple of options:
you can raise CloseSpider exception in a spider callback, maybe when you catch that exception you mention
you can call crawler.engine.close_spider(spider, 'some reason') if you have a reference to the crawler and spider object, for example in an extension. See how the CloseSpider extension is implemented (it's not the same as the CloseSpider exception).
You could hook this with the spider_error signal for example.

Paypal sandbox negative testing not working

I have set up negative testing for an account then set the error code desired as the Transaction Amount Field for example 106.06 to invoke error code 10606 "Buyer cannot pay” no errors are returned the order is processed.
If I try another error code 10539 “This transaction cannot be processed”. An error is return and the order is not processed.
I am using the The US site error codes: http://www.paypalobjects.com/en_US/ebook/PP_APIReference/Appx-ErrorCodes_and_Messages.html and we are in Australia are these the correct error codes?
Any ideas what is causing this? Is this the correct way to use Negative Testing in the sandbox?
Thanks
I know this is late but I stumbled across the answer for me.
You didn't specify the API Name you are working with DoExpressCheckoutPayment and according to Paypal's Negative Testing Docs we are supposed to use an AMT field and
To trigger an error condition on an amount-related field, specify a error code value as a number with two digits to the right of the decimal point. For example, specify a value of 107.55 to trigger the 10755 error.
I found their information to be completely false! What I finally got working was to use PAYMENTREQUEST_0_AMT and NOT use a decimal.
So here is what I came up with
USER={yourUID}&
PWD={yourPSWD}&
SIGNATURE={yourSig}&
TOKEN={yourToken}&
METHOD=DoExpressCheckoutPayment&
VERSION=119&
PAYMENTREQUEST_0_AMT=10486
Edit:
I later found a better option specifically for the Payment Method Refused (10486) that I mentioned above. Take a look: https://developer.paypal.com/docs/classic/express-checkout/ht_ec_fundingfailure10486/#testing-saleorauth

OpenRasta project keeps throwing InvalidOperationException

This happens when the project is running... when we are on a page (for example /Project) everything renders fine... but at random time (I can't figure out when it happens) it just gets thrown.
This is the stacktrace
at System.Web.HttpApplication.ThrowIfEventBindingDisallowed()
at System.Web.HttpApplication.RemoveSyncEventHookup(Object key, Delegate handler,
RequestNotification notification, Boolean isPostNotification)
at System.Web.HttpApplication.remove_PostResolveRequestCache(EventHandler value)
at OpenRasta.Hosting.AspNet.OpenRastaModule.<>c__DisplayClass2.<Init>b__1() in c:\TeamCity\buildAgent\work\446ececd36f5f871\src\OpenRasta.Hosting.AspNet\OpenRastaModule.cs:line 75
at OpenRasta.Hosting.AspNet.OpenRastaModule.Dispose() in c:\TeamCity\buildAgent\work\446ececd36f5f871\src\OpenRasta.Hosting.AspNet\OpenRastaModule.cs:line 66
at System.Web.HttpApplication.DisposeInternal()
I hope someone can clarify what I'm doing wrong :)
That'd be because you're on master and that's including some silly code that tries to cleanup stuff that shouldn't be.
Expect a commit this afternoon that'll fix that.

Resources