Handle FileNotFoundException thrown by ImageResizer.AzureReader2 (BlobNotFound) - exception

I'm running an MVC app on Azure. I use the AzureReader2 plugin. It's been working fine for years.
But when this hits missing images, it throws FileNotFoundException exception and this apparently breaks down user authentication, causing user to be redirected to login page.
Is there a way to prevent this? How can I catch and handle this exception for the URL API?
I am considering the Image404 plugin. But I am not sure it works with AzureReader2 plugin (?)
Exception handling would be best for me as I could take some other actions.
Thanks

You can see the Image404 plugin source code on GitHub. There is a Config.Current.Pipeline.ImageMissing event that it handles - you can plug into the same event to do your own logic.
It should work fine with AzureReader2.
Note that most likely your 404 page is set to require authentication, which is why it is redirecting.

Related

WebAssembly crash info in window.onerror()

I am trying to collect crash logs for my WebAssembly application. It's built with emscripten, everything is served from the same domain, testing in Chrome. In the developer console I see a proper error with stack trace when a crash occurs, I'd like to capture this and send it to a server.
Instead I am only getting "Script error." passed to window.onerror() and the fifth parameter is null. This is supposed to happen when violating the same-origin policy (linked question is only about javascript, does not talk about this WebAssembly-specific problem.) Errors occurring in the .js file don't have this problem, only webassembly runtime errors.
I added the crossorigin attribute to the .js file generated by emscripten. The site is running in secure context, the Response object passed to WebAssembly.instantiateStreaming() (in the emscripten-generated .js file) has "basic" as its .type, so as I understand it has no restrictions on what can be done with it. "Access-Control-Allow-Origin" header is set to "*".
For some weird reason I managed to get the full error with stack trace exactly once, so it is apparently possible, but seemingly doing everything the same way I can't get it to work again.
How can this be solved?
instantiateStreaming is promised based so maybe try window.addEventListener('unhandledrejection')?

Why does Adyen Alipay (test env) url show ILLEGAL_SIGN error?

I've been attempting to integrate with Adyen and was successful on some of the payment methods like Diners, JCB, Unionpay. However for Alipay, I've been getting this ILLEGAL_SIGN sign error and I can't find anything in the documentation related to this. Following this documentation: https://docs.adyen.com/payment-methods/alipay/api-only, on /payments call, Adyen will return a url. After going to this url, a page with ILLEGAL_SIGN error is shown. What could have caused this?
I tried Adyen's sample rails app (https://github.com/adyen-examples/adyen-rails-online-payments). In this sample app, the other payments are ok but for Alipay it also gets this ILLEGAL_SIGN error.
Adyen sandbox pages are not maintained by them, therefore it is quite likely that there is something between Adyen and Alipay that is causing this problem. I would just contact their support and ask them to take a look to it.

Typo3 extbase : How can i catch an exception?

I'm currently develloping an extension in Typo3 10.4 and I can't working out a problem
I'm using some external libs for mailing or payments which sometimes throw exceptions.
My problem is that when this is happening i got an OOPS error even if I try to catch the exception
for exemple :
//CODE BEFORE
try{
//SOME CODE WHO SENDS EMAIL AND SOMETIMES THROW EXCEPTION
//BECAUSE THE CONNECTION FAILED
}catch(Exception $e){
//DO SOMETHING
}
//CODE AFTER
And it's a pretty annoying problem because some DB actions are not completed then
I'm sure there is a way to deal with the exception without stopping all the script but i don't know how...
Can someone help plz?
Thanks guys
Your approach is correct and TYPO3 shouldn't interfere. Thus, there seems to be another issue, so a few things to consider here:
Please keep in mind that your TYPO3 extension code is namespaced, if you really catch(Exception $e) it means \Your\Namespace\Exception - you probably want catch(\Exception $e).
That said, additionally configure a way to show the exception stack trace instead of "Oops" as output (the more simple approach, see e.g. How do I enable Error Reporting in TYPO3?) or connect a remote debugger like xdebug (more advanced) in order to see more than the Oops and get the real cause of the error and how it propagates.
If you aren't able to change the actual TYPO3 system you work on for reasons, an alternative could be to use an easy to set up local dev system like DDEV. This offers a simplified way to create a local TYPO3 instance, see e.g. the TYPO3 blog article

Cannot get cookies in WebBrowser in windows phone 8?

In my windows phone appliation, i'm using Web Browser. And my xaml code for the web browser is,
<phone:WebBrowser IsScriptEnabled="True" Navigating="NAvigating" Navigated="Uri_Navigated" x:Name="browserControl" Margin="-1,55,0,0" />
When i get cookies from Uri_Navigated function everything works fine, but when i try to get the cookies from NAvigating function,when i execute the code,
cookies = browserControl.GetCookies();
I get an exception stating that,
An exception of type 'System.InvalidOperationException' occurred in Microsoft.Phone.Interop.ni.dll but was not handled in user code
What is the problem? how should i get the cookies in NAvigating function??
The exception that is thrown when a method call is invalid for the
object's current state.
I guess this is by design. It won't give you the existing cookies because they are already stale and it won't give you the new cookies because they are not created yet.

HTML 5 Application Cache catch events in Chrome

I've created a website using HTML 5 offline Application Cache and it works well in most cases, but for some users it fails. In Chrome, when the application is being cached, the progress is displayed for each file and also error messages if something goes wrong, like:
Application Cache Checking event
Application Cache Downloading event
...
Application Cache Progress event (7 of 521) http://localhost/HTML5App/js/main.js
...
Application Cache Error event: Failed to commit new cache to storage, would exceed quota.
I've added event listeners to window.applicationCache (error, noupdate, obsolete, etc.), but there is no information stored on the nature of the error.
Is there a way to access this information from the web site using JavaScript ?
I would like to determine somehow which file caused the error or what kind of error occurred.
I believe that the spec doesn't mention that the exact cause of the exception should be included in the error. Currently the console is your only friend.
To wit, your current error "exceed quota" is due to the fact that Chrome currently limits the storage to 5MB. You can work around this by creating an app package that requests unlimited_Storage via the permission model. See http://code.google.com/chrome/apps/docs/developers_guide.html#live for more details.
If you want specific error messages on the "onerror" handler raise a bug on http://crbug.com/new