exception-handling

How to route the exe exception back to VB6 app?

久未见 提交于 2019-12-12 19:12:53
问题 i have a vb6 apps which will call the mencoder.exe which is part of the mplayer to convert some files into flv format. i'm getting this weird unhandled exception problem from mencoder whenever i try to convert this one opendivx file. At the moment, i'm unclear of whether is this codec is the culprit behind this. Either way i have try to modify the command line and even downloaded the latest available version for mencoder. so the conversion works fine and the only problem is that the mencoder

DataValidation in WPF using ValidatesOnExceptions

孤街醉人 提交于 2019-12-12 19:08:09
问题 I want to run a basic data validation sample in WPF using ValidatesOnException , but its simply not working, and as soon as my viewmodel throws ValidationException , my program crashes saying, ValidationException was unhandled by user code . My View Model is public class MainViewModel : INotifyPropertyChanged { //INotifyPropertyChaned implementation ////////////////////////////////////// private string stringValue; public string StringValue { get { return stringValue; } set { if (value.Length

Enterprise Library 5.0 - Adding custom tokens to a TextFormatter

依然范特西╮ 提交于 2019-12-12 18:23:20
问题 I have created a custom Exception that has data pertaining to our application. I want to ensure this data gets logged when an exception is thrown and logged to the event log. I have tried creating a custom TextFormatter which is being called but am not sure how to access the current exception so I can add our custom information to the log entry. There is something I am not understanding and would appreciate any help around adding custom tokens (and data) to Enterprise Library 5.0

ExceptionHandler for a pre-controller Filter (Spring Security)

你。 提交于 2019-12-12 18:17:24
问题 I have a question about the exceptions on the Spring security level. I user the SM_USER header for authorization and for the validation the request goes through the DelegateRequestMatchingFilter (it helps to understand whether the SM_USER is needed). The problem is that if there is no SM_USER-header at all the line super.doFilter(...) throws a PreAuthenticatedCredentialsNotFoundException which cannot be processed with the standard ExceptionResolver for controllers and that's why looks strange

VS2008 Enable C++ Exception with SEH

 ̄綄美尐妖づ 提交于 2019-12-12 17:02:22
问题 I don't want my program to crash, so i enabled C++ Exception with SEH. So that, if there's some errors i.e. NULL pointer access happens, my program can catch it with catch(...). I want to known: 1. Is there any drawback of enable C++ exception with SEH? 2. How can i know exception details when it is catched by catch(...)? 回答1: As far as I know, there are no performance drawbacks, because I'm pretty sure C++ exceptions are implemented via SEH anyway. All you're doing is enabling the extension

Logging unhandled exceptions in Android Activity

偶尔善良 提交于 2019-12-12 16:46:55
问题 I have created a class BaseActivity extends AppCompatActivity from which all my Activites in an Android App are inheriting. In this class I intended to catch all unhandled exceptions, so I can write them to a local SQLite database for later inspection / sending to remote server. Below I attach entire class code: public class BaseActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Thread

Why does this code crash on the distributed app but work in the debugger?

人盡茶涼 提交于 2019-12-12 16:43:56
问题 I have simple code that executes and in case it crashes I want to catch the exception so the app does not crash. @try { x = [self try_doMyWork:Param]; } @catch (NSException* e) { NSLog(@"Exception"); } While this code works in debug and catches the exception (which is a simple index beyond end of array) it crashes in distributed apps on iPhones. Why is this and how can I ensure that it also works on distributed apps? 回答1: Uncaught application-level exceptions are only one cause of crashes.

Unexpected behavior with exception handling in async, possible bug?

前提是你 提交于 2019-12-12 16:19:17
问题 I have stumbled upon a problem when calling a nested Async which happens to be null. An exception is raised but it can't be catched with any of the normal exception handling methods Async workflows provide. The following is a simple test which reproduces the problem: [<Test>] let ``Nested async is null with try-with``() = let g(): Async<unit> = Unchecked.defaultof<Async<unit>> let f = async { try do! g() with e -> printf "%A" e } f |> Async.RunSynchronously |> ignore which results in the

Can I throw a unique_ptr?

自古美人都是妖i 提交于 2019-12-12 15:56:09
问题 I have started using C++ 11 and in particular using unique_ptr liberally to make code exception-safe and ownership more readable. This has generally worked well until I wanted to throw a unique_ptr. I have error code (thrown many places, caught in a single place) that creates complex state. Since the ownership of that dynamically allocated memory logically is being transferred from the thrower to the catcher, unique_ptr seemed like the appropriate type to indicate that and make it clear that

Python: Timeout Exception Handling with Signal.Alarm

爱⌒轻易说出口 提交于 2019-12-12 15:17:19
问题 I am trying to implement a timeout exception handler if a function call is taking too long. EDIT : In fact, I am writing a Python script using subprocess, which calls an old C++ program with arguments. I know that the program hangs from time to time, not returning anything. That's why I am trying to put a time limit and to move on to next call with different argument and etc. I've been searching and trying to implement it, but it doesn't quite work, so I wish to get some help. What I have so