I'm working on a coarse API for performing higher level business functions. Under many conditions these functions may fail in a way that is expected (not exceptional), ie. the function may not be able to complete because of failing a validation condition of some kind.
In many cases, what I want to do in these "failure" scenarios is to alert the user and give them the option to "override" the failure. ie, "Warning: transferring warp power to the shields will damage the emitter array, are you sure you want to proceed?"
Many of these functions may have a list of quite a few validation rules and I may want to override all of them.
What I'm envisioning right now is to create a custom MyResult class that is returned by the functions that includes whether or not the function succeeded and if it failed, perhaps a list of validation rules that failed for the function. Then add a parameter to the function for "overrides" that allows these validation rules to be bypassed in a subsequent call. I'd like feedback on this approach. Is there a pattern for this?
The functions in the API may be called from multiple platforms and the API itself is in C#.