Search code examples
caliburn

Caliburn issues - RescueAttribute not working


I have some issues with getting the RescueAttribute in Caliburn 1.1.0 to work. Basically I intend to put a general catch-all exception handler in every view model, but I it seems like the method never gets called.

[PerRequest("ConfigurationGroupViewModel")] [Rescue("GeneralRescue")] public class ConfigurationGroupViewModel : Presenter {

................

public void GeneralRescue(Exception ex) { MessageBox.Show(ex.Message); }

}

I have followed exactly what was specified in the Caliburn documentation, and I saw a post earlier that mentioned something about IConventionManager but my concern is that even by putting the rescue method directly on the ViewModel class itself the rescue method never gets called. Can anyone assist me in this?

Thanks!


Solution

  • Could you please provide some other details?

    • Are you invoking action with messaging infrastructure or manually? (Rescue only works in the first case)
    • Are you calling a regular action or a coroutine (IEnumerable)?