The OnError is called when ever there is an Exception within an Action. All I did was simply find all the Rescue Attributes on the controller class and iterate through all the registered exception types. If it finds a registered exception type it looks for a PreAction delegate or lambda and invokes it (still working on this but I thought it was overkill).

Finally it Renders the rescue view in the Rescue folder.

That’s it!

Now my controller looks like this (check out the new hip name for the convention controller:

Related Articles:

About Joe Ocampo

My personal philosophy is simple:
"Have a good strategy that sets the environment for success through the enablement of the whole.
Be agile but with a mind towards pragmatism.
Delegate to the best qualified individuals, but don’t be afraid to involve yourself in all parts of a job.
Treat everyone with respect, humility, and with a genuine pursuit towards excellence."
Respected business and technical leader with expertise in directing organization towards effective results driven outcomes. Proven ability to perform and communicate from both technical and business perspectives. Strong technical and business acumen developed through experience, education and training. Provides the ability to utilize technology, harness business intelligence and execute strategically by optimizing systems, tools and process.
Passionate about building people, companies and software by containing cost, maximizing operational throughput and capitalize on revenue. Looks to leverage the strengths of individuals and grow the organization to their maximum potential by harnessing the power of their collective whole and deliver results.
Co-Founder of LosTechies.com