ServiceStack/ServiceStack — pull request #821 by yeurch (2013-09-06 00:09:05+00:00)
Title: Fix behavior of HandleUnknownAction

Following [discussions on Google+](https://plus.google.com/u/0/112137203682867776670/posts/jJHThpRN3in) I've changed the way `ServiceStackController` overrides `HandleUnknownAction`.

Previously, if a non-existant action was called on a controller (e.g. ~/Home/DoesNotExist), then instead, the Index view would be returned. In such a case, a 404 should be expected, which is now what happens, provided that `ServiceStackController.CatchAllController` is not specified.

However, if `ServiceStackController.CatchAllController` is specified, then instead, the default action of the catch-all controller is executed instead of showing the 404.

Please note that the public method `ServiceStackController.InvokeDefaultAction` is no longer called by `HandleUnknownAction`, and it is also __somewhat problematic__. `InvokeDefaultAction` (which is no longer called from within the ServiceStack framework), does not actually invoke the default action. Instead, it attempts to render the default **view** of the current controller. If an exception is thrown while doing this (typically because ViewState has not been initialised correctly as no action method has executed), then instead it falls back to execute the catch-all controller's default action if it is specified. If it is not specified, then this falls through to returning an empty page. Not ideal!

Given that `InvokeDefaultAction` is no longer called from the framework, is there any point in it still existing? After all, if a client wanted to call it, they would be better served by calling `return Index(args ...)` wouldn't they?