exception-handling

Critique my exception handling strategy

你离开我真会死。 提交于 2019-12-06 12:07:21
问题 I've been doing object-oriented programming for most of the past 7 years, using Java on and off during that time. Some things I'm certain I have an excellent grasp of, such as the most useful design patterns. In fact, the following code allowed me to crank out a little system in under a day's time, that would handle the one particular instance we are ready to implement now, while being flexible enough to handle the future requirements I've been informed of: public void importAndArchive(File

How to catch Exception Message in Erlang?

我的未来我决定 提交于 2019-12-06 11:46:17
This is the Exception message thrown by Gen_server when its not started. (ankit@127.0.0.1)32> R11 = system_warning:self_test("SysWarn"). ** exception exit: {noproc, {gen_server,call, [system_warning_sup, {start_child, {system_warning_SysWarn, {system_warning,start_link,[{system_warning_SysWarn}]}, permanent,10,worker, [system_warning]}}, infinity]}} in function gen_server:call/3 in call from system_warning_sup:'-start_child/1-lc$^0/1-0-'/1 in call from system_warning:self_test/1 (ankit@127.0.0.1)33> R11. * 1: variable 'R11' is unbound Now, What I want to do is to catch this exception message &

Is it possible to have one Exception handler for multiple timers in a C# class?

我只是一个虾纸丫 提交于 2019-12-06 11:45:55
I have a C# program which runs a system tray application - transferring / moving / creating / editing files in the background. There is alot of exception handling and loop handling to prevent the program from crashing / getting stuck if the user manual deletes a file the program is working with. Unfortunately one of the computer the program is running on is having the program crash. The computer is very hard to get, and cannot have debugging software loaded on (it is an embedded PC outside with no network access). I have tried finding the cause of the crash (such as an unhandled exeption)

Throwing exceptions from JBPM WorkItemHandlers?

回眸只為那壹抹淺笑 提交于 2019-12-06 11:43:51
I'm a little confused about the subject of throwing exceptions from JBPM work item handlers and handling the exception elsewhere in the business process. We're using JBPM 6.0.3 to run in Jboss EAP 6.1. The JBPM User Guide implies that you should never throw exceptions from within a WorkItemHandler. Instead, the handler should catch them and either handle them some way or else convert them to an error message, signal, or similar. JBPM even provides work item handler wrappers which catch signals and converts them to messages for you. There's no discussion in the user guide about handling

Where can I catch non rest controller exceptions in spring?

一曲冷凌霜 提交于 2019-12-06 11:31:47
问题 I have the spring mvc application. To catch exceptions I use @ExceptionHandler annotation. @ControllerAdvise public class ExceptionHandlerController { @ExceptionHandler(CustomGenericException.class) public ModelAndView handleCustomException(CustomGenericException ex) { .... } } But I think that I will catch only exceptions after controller methods invocations. But how to catch exceptions generated outside the rest context? For example lifecycle callbacks or scheduled tasks. 回答1: But how to

Get the method name and it's contained parameters by parsing the exception

拥有回忆 提交于 2019-12-06 11:30:50
问题 When I received an exception such as IOException or RunTimeException , I can only know the line number in the class. First of my question. Is it possible to retrieve the method name through exception? Second, is it possible to retrieve the method and the parameter of this method by line number? p.s. I need to know the exact method name and its parameters, because I want to distinguish the overloading methods. To distinguish overloading methods, all that I know is to determine its parameters.

How to deal with exceptions

China☆狼群 提交于 2019-12-06 10:13:21
问题 My technical lead insists on this exception mechanism: try { DoSth(); } catch (OurException) { throw; } catch (Exception ex) { Util.Log(ex.Message, "1242"); // 1242 is unique to this catch block throw new OurException(ex); } 1242 here is an identifier of the catch method which we handle an exception other than OurException. Every catch block in the project must have a unique identifier so we can know where the exception occurred by looking at the logs. For every method, we have to catch

GWT client not receiving IncompatibleRemoteServiceException when serialization policy changes

隐身守侯 提交于 2019-12-06 10:13:07
问题 When the new version of app is deployed with changes to the model classes (for example adding/removing fields ). Client who has old version running gets com.google.gwt.user.client.rpc.SerializationException with the RPC made with the old client code and this is expected behavior. As a result we expect to see IncompatibleRemoteServiceException on the client side. However we get StatusCodeException. StatusCodeException is 500 error and we can't customize the client side behavior easily (we don

Exception Handling

て烟熏妆下的殇ゞ 提交于 2019-12-06 09:55:27
问题 Is Structured Exception Handling bad? What is the right way to handle exceptions? EDIT: Exception Handling in .NET using C#. I usually have a set of specific exception classes (DivideByZeroException, ArrayTypeMismatchException) and don't have a generic "catch (Exception ex)". The thinking behind this is that I expect certain types of exceptions to occur and have specific actions defined when they occur and the unexpected exceptions would rise up the the interface (either windows or web). Is

Using Enterprise Library Exception Handling Application Block in ASP.NET - Code Review

佐手、 提交于 2019-12-06 09:53:34
问题 I'm implementing the Enterprise Library Exception Handling Application Block in an ASP.NET application that I am building. I'm planning to handle uncaught application exceptions by placing the following code in my Global.asax.cs: protected void Application_Error() { Exception error = Server.GetLastError(); Exception errorToThrow; if (ExceptionPolicy.HandleException(error, "Application Error", out errorToThrow)) { if (errorToThrow != null) throw errorToThrow; } else Server.ClearError(); } I