exception-handling

Getting EXC_BAD_ACCESS crash with UISearchBar Method

烈酒焚心 提交于 2019-12-11 10:25:00
问题 I have a UISearchBar setup and when its being used, it has an overlay grey view that covers the rest of the table similar to how apple does it. When I click this darkened view, it exits search mode, which is good, but when I search again, then again click the grey to exit, it crashes with EXC BAD ACCESS error. Here is some related code: The crash is always at [rvController doneSearching_Clicked:nil]; OverlayViewController.h @interface OverlayViewController : UIViewController @property

Using Facelets as <error-page><location> causes IllegalStateException: getWriter() has already been called for this response

狂风中的少年 提交于 2019-12-11 10:03:21
问题 I'm trying to setup the Omniface's FaceExceptionFilter on my Glassfish 4.0 server, using Mojarra 2.2.8, Primefaces 4.0 and Omnifaces 1.8.1. The filters and error pages in web.xml are defined as follow: <filter> <filter-name>facesExceptionFilter</filter-name> <filter-class>org.omnifaces.filter.FacesExceptionFilter</filter-class> </filter> <filter-mapping> <filter-name>facesExceptionFilter</filter-name> <servlet-name>Faces Servlet</servlet-name> </filter-mapping> <filter> <filter-name

How to catch an exception and show its details [closed]

时光怂恿深爱的人放手 提交于 2019-12-11 09:55:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm wondering how I'd go about catching an error and then displaying its details in a custom ListBox or something. The idea is to allow a custom message to appear that's simple, like "Woops, something's went wrong!" but still be able to provide the information for troubleshooting. If someone could help me build

Catch SomeException with ExceptT

泪湿孤枕 提交于 2019-12-11 09:48:51
问题 I'm trying to use the ExceptT monad transformer to catch any exception thrown by a function, like so: import Control.Exception import Control.Monad.Trans.Except badFunction :: ExceptT SomeException IO () badFunction = throw DivideByZero main :: IO () main = do r <- runExceptT badFunction case r of Left _ -> putStrLn "caught error" Right _ -> putStrLn "nope, didn't catch no error" ... but the exception happily flies by. What am I doing wrong? Edit : to clarify, the aim is to catch any

How to get a list of concrete Exceptions thrown by a method in Eclipse

风流意气都作罢 提交于 2019-12-11 09:14:22
问题 Is is possible to get a list (and catch) of the concrete exceptions that can be thrown by a method? I am calling an API that uses a hierarchy of exceptions, but only declares the top level exception to a method. I want to be able to provide specific behaviour based on the exception, but I don't want to have to trace through the code to find the concrete exceptions that can be thrown. There may be added complications that the API contains a number of layers separated by interfaces. Simple

Java: Proper way to throw and catch an exception to validate input

流过昼夜 提交于 2019-12-11 09:13:51
问题 Im writing a program for homework where I need to validate user input and then create an object and add it to an array list. i have included just what i think is the relevant code, but im a beginner for sure so let me know if there is something else you need to see. I have the user enter a string, then check to see if its a double. if its not a double, i throw an exception that i created try{ price = Double.parseDouble(strPrice); } catch(NumberFormatException nfe){ CDException cde = new

Exceptions or not? If “yes” - checked or not?

可紊 提交于 2019-12-11 09:04:56
问题 I suppose this scratches a vast topic, but what is the best approach in handling program work-flow other than the ideal variant when everything gets done the best way. Let's be a bit more specific: a class has a method, that method operates on its parameters and returns result. e.g.: public Map<Object,OurObject> doTheWork(OtherObject oo); One possible outcome that I ruled out was returning null if something went other way, but the ideal. Is there a correct way ("silver bullet", or so called

no redirect to page specified in web.xml

▼魔方 西西 提交于 2019-12-11 08:42:59
问题 in my JSF application whenever an exception occurs, it should display a JSF page, which I designed to show the user that an error occurred, but no such thing happens, that's the big problem. Part of my web.xml <error-page> <exception-type>java.lang.Exception</exception-type> <location>/faces/error.jsf</location> </error-page> <error-page> <error-code>500</error-code> <location>/faces/error.jsf</location> </error-page> 回答1: That can happen when the exception occurs during an ajax request, or

Cannot get HTML of page

流过昼夜 提交于 2019-12-11 08:20:03
问题 I want to get HTML using the HTTPWEBREQUEST for the following page: http://inkdispatch.com/brother Currently i am using : public static string getHTML(string url) { string responseData = ""; try { // System.Threading.Thread.Sleep(1000 * 1); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Accept = "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint,

Exception handling for common lisp package enumeration

南楼画角 提交于 2019-12-11 07:59:39
问题 So running this lisp code to get all symbols in the common-lisp-user package: (do-symbols (sym 'common-lisp-user) (print sym)) I get this error: * - PRINT: Character #\u0420 cannot be represented in the character set CHARSET:CP437 I'm not extremely familiar with exception handling in Common Lisp. I've tried handler-case, and restarts, etc, but I haven't yet been able to trap the error and then just carry on. Any help with this would be appreciated. FYI, this is on a windows machine running