I've got a site that makes extensive use of /Base methods to expose data via JSON, but can't disable verbose stack traces (usually the opposite problem!).
All the usual web.config settings are set to production;
var result = method.Invoke(urlParts.Skip(2).ToArray()); if (result.Length >= 7 && result.Substring(0, 7) == "<error>") { context.Response.StatusCode = 500; context.Response.StatusDescription = "Internal Server Error"; } context.Response.Output.Write(result);
That to me looks like the result of the base method is always returned in the response. I guess I need to try {} catch {} everything, and return my own error?
Base methods revealing stack trace
I've got a site that makes extensive use of /Base methods to expose data via JSON, but can't disable verbose stack traces (usually the opposite problem!).
All the usual web.config settings are set to production;
Yet when poked, the /Base methods expose a full stacktrace.
Any ideas how I can prevent this? Is it inherent to base methods?
Phil
Looks like this might be inherent - from the Umbraco source;
Umbraco\src\Umbraco.Web\BaseRest\BaseRestHandler.cs:85
That to me looks like the result of the base method is always returned in the response. I guess I need to try {} catch {} everything, and return my own error?
is working on a reply...