Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

ContentDataCommitter catches Exception but does not log it.

Found in

EPiServer.Cms.UI 7.5

Created

Jun 26, 2014

Updated

Dec 11, 2014

Area

Falcon/CMS/Edit UI

State

Closed, Fixed and Tested


Steps to reproduce

The method Commit of EPiServer.Cms.Shell.UI's ContentDataCommitter tries to apply the changes and call the ContentRepository.Save to publish the page. As a precaution, it catches all exceptions that can be thrown and reformats them as a Json-response transmittable by the REST-store. However, it catches Exception which is a type too generic to be able to handle. As such, the REST store response can be "Object reference not set to an instance of an object" with no additional information available in log files or elsewhere.

catch (Exception e)
{
    results.Success = false;
    results.Id = change.ContentReference;
    results.ValidationErrors = new [] { new ValidationError {ErrorMessage = e.FormatMessageRecursive(" "), Severity = ValidationErrorSeverity.Error} };
    return results;
}

 

At the very least, the exception (with stack trace) should be logged to the Error log.

 

We should also log the exceptions we are catching in the ContentChangeManager #updateProperties