In symfony 1.0 you can access the uncaught exception causing your custom 500 error page to appear through $this in your error500.php. How can this be accomplished in 1.1?
Turns out it's available in $exception in 1.1.
Related
I'm running Symfony 4/5, and for all my controllers in order to be able to execute the method I have an EventSubscriber that checks for the right permissions.
If the user is not granted, then it throws an AccessDeniedHttpException.
This works fine as the method is binded to a route.
But when rendering inside a twig template manually a controller action as :
{{ render( controller('App\\ExampleBundle\\Controller\\ChartsController::renderChart' ) }}
I got a 500 error instead of a 403.
I've debugged the app and checked that the exception as actually thrown, but the browser shows a 500 exception.
Is this a bug, or do I have to handle in another way the exception when it is for manually rendered methods from a twig template ?
According to http://www.michael-whelan.net/replacing-appdomain-in-dotnet-core/ some AppDomain functionality were replaced in .NETCore.
But I can't find the way to be notified about every unhandled exception occurred in my application. Is there any way to do that?
Unfortunately, you need to wait for .NET Core 1.2
... AppDomain.UnhandledException came back with dotnet/corefx#11275.
I use JRuby with jxBrowser. I´ve just upgraded to version 6.8 and my application stopped working. I think the problem comes with the new #JSAccessible annotation. JRuby does not allow method annotation and I inject a JRuby class into a javascript. What used to work now gives me the following message:
Unhandled Java exception: com.teamdev.jxbrowser.chromium.JSFunctionException: Uncaught TypeError: Cannot read property 'set_this' of undefined
Is it possible to not require the #JSAccessible annotation and bring back the functioning of version 6.7?
To bring back functionality of version 6.7 you just need to avoid using the #JSAccessible annotation in your code. This annotation represents an extension to the current API. If you don't use this annotation, the behavior is the same as in previous versions.
I need to handle Faces Exception thrown and display custom page on being caught.
I found the answer I tried overriding the MyFaces exception in web.xml and created a separate bean for handling all the bad request.It worked for me.
Out of the box WebSphere Portal displays a generic "This portlet is temporarily disabled." message for any portlet that throws an uncaught exception.
Does anyone know how how this can be overridden - preferably to provide custom error pages for specific exceptions in the same way error pages can be configured in the web.xml of a standard J2EE app?
Using the web.xml of the portlet to define error pages for exceptions does not work. Can't find any documentation on this anywhere.
Using WebSphere Portal 6.1.5, JSR 286 portlets.
Found out - the message is taken from the inside of the portletRender tag in the skin, e.g:
<portal-skin:portletRender>
<span style="color:#FF0000;"><portal-fmt:problem bundle="nls.problem"/></span>
</portal-skin:portletRender>
So it must be defined in the Theme - not on a per-portlet basis, but as JSP code is supported in the tag body more complex behaviour can be specified.