exception-handling

Whats this exception?

有些话、适合烂在心里 提交于 2020-01-06 20:16:17
问题 I have an activity (BookMarks) that is called from main activity. BookMarks throw an exception (not all the time) I can't figure out what this exception means. I/ActivityManager( 181): START {cmp=com.unreal.muslim/.BookMarks} from pid 25558 I/WindowManager( 181): createSurface Window{41fbf070 Loading... paused=false}: DRAW NOW PENDING I/WindowManager( 181): createSurface Window{41da2230 com.unreal.muslim/com.unreal.muslim.BookMarks paused=false}: DRAW NOW PENDING E/bm run catch(25558): Only

SQL Stored Procedure Exception Not Found in JAVA

。_饼干妹妹 提交于 2020-01-06 20:09:59
问题 Throwing exception from sql stored procedure catch block is not raising exception in java layer for SP1 while for SP2 exception raised. When I am executing both SPs are giving exception in SQL Server but from java code I got no exception for SP1. I am calling both SPs using JPA StoredProcedureQuery and using Hibernate & Spring. CREATE PROCEDURE SP1 AS SET NOCOUNT ON BEGIN TRY DECLARE @ErrorMessage AS VARCHAR(MAX) SELECT 1/0 END TRY BEGIN CATCH THROW 50001, @ErrorMessage, 1; END CATCH CREATE

pass the ELMAH error sequence number (not GUID) for the exception to custom error page in ASP.NET

痴心易碎 提交于 2020-01-06 19:24:46
问题 I want to show the sequence number for the exception (from sequence number column in ELMAH_Error table) , not the GUID to the user whenever an error occurs. is this possible? I found this post Problem passing ELMAH log id to Custom Error page in ASP.NET, but it gives the GUID, I would like to know how I can access the sequence number in Logged event of ELMAH component? thanks in advance. 回答1: Some Background... ELMAH is designed to log errors to a specified log source . The most common log

DirectX Exception handling

坚强是说给别人听的谎言 提交于 2020-01-06 16:46:06
问题 I'm following the rastertek tutorial on DirectX while also studying Exception-Safety in Generic Components by David Abrahams (http://www.boost.org/community/exception_safety.html). Why (to the best of anyone's knowledge) is the exception handling set up the way it is in the rastertek tutorial and what level of protection does it offer? For instance: mhresult = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &mfeatureLevel, 1, D3D11_SDK_VERSION, &mswapChainDesc,

__try/__finally equivalent in UNIX

99封情书 提交于 2020-01-06 15:52:27
问题 I have a library that written mostly in C, Some parts of it should be thread safe and I use global spinlock to protect the critical section of the code. Now my problem is: I should call some callback of the user from inside of a critical section that protected by a spinlock and in case that those callbacks generate an exception, on Windows I have a _ try/ _finally in C to be able to leave the critical section even when an error occurred. Can I accomplish this on UNIX too? 回答1: This is called

PowerShell executes the wrong exception handler

假如想象 提交于 2020-01-06 14:46:18
问题 I think I have found a nasty bug in PowerShell 4.0 exception handling but I'm new to PowerShell scripting and want to be sure I didn't miss something. I managed to find a code that reproduces the problem: foreach ($id in 1..20) { try { # The objective is to generate basic exceptions and see how they are caught throw "#$id" } # Oddly, if the following block is removed or commented, there is no problem catch [System.ArithmeticException] { Write-Host ("[ArithmeticException] {0}" -f $_.Exception

Custom handling of exceptions during AJAX request is causing a HttpException

核能气质少年 提交于 2020-01-06 09:03:51
问题 When my application encounters an exception of type UnauthorizedAccessException during an AJAX request, I want to handle the behaviour myself and return a custom JSON response. So I have overridden the OnException method in a base controller, which all my conrtollers inherit from, like this: protected override void OnException(ExceptionContext filterContext) { var exception = filterContext.Exception; if (exception is UnauthorizedAccessException) { filterContext.ExceptionHandled = true; if

Custom handling of exceptions during AJAX request is causing a HttpException

a 夏天 提交于 2020-01-06 09:03:43
问题 When my application encounters an exception of type UnauthorizedAccessException during an AJAX request, I want to handle the behaviour myself and return a custom JSON response. So I have overridden the OnException method in a base controller, which all my conrtollers inherit from, like this: protected override void OnException(ExceptionContext filterContext) { var exception = filterContext.Exception; if (exception is UnauthorizedAccessException) { filterContext.ExceptionHandled = true; if

How do I always get COMException instead of OutOfMemoryException?

十年热恋 提交于 2020-01-06 08:00:11
问题 My C# code consumes a COM object. Sometimes that COM object methods will return E_OUTOFMEMORY but it will get translated into System.OutOfMemoryException instead of System.Runtime.InteropServices.COMException with appropriate ErrorCode . This is a problem for me because it complicates my error handling - I'd prefer to have all error indications that arise from COM object methods being thrown as System.Runtime.InteropServices.COMException only. Is it possible to always have System.Runtime

JSF session timeout & Exception handling [duplicate]

纵饮孤独 提交于 2020-01-06 07:56:21
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: JSF 1.2 Exception Handling In the web.xml, i had the session-config as follows <session-config> <session-timeout>2</session-timeout> </session-config> and i also have a error-page defined as follows <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/sc00/ErrorPage.jsp</location> </error-page> and when the application times-out i am unable to direct to the