Hello Team,
Is it possible, for security reasons, to hide errors and display a generic message like ’ there was a problem with rendering. Please contact us via…’?
ShowExceptionDetailsOnClient option set as false is still displaying some information about the error that has occurred (see attached).
Thank you!
Hello Deric,
Hello Pavel,
Although I see error in viewer, debugging is not going through HandleEvent code that I added in Global.asax.cs:
public class DocumentOpenSubscriber : IEventSubscriber
{
public void HandleEvent(IEvent eventDesc)
{
myException exception;
IDocumentProcessingEvent documentEvent = (IDocumentProcessingEvent)eventDesc;
string path = documentEvent.DocumentPath;
DocumentOpeningErrorEvent errorEvent = eventDesc as DocumentOpeningErrorEvent;
if (errorEvent != null)
{
if (errorEvent.Exception != null)
{
exception = new myException(“Custom Message”, errorEvent.Exception);
}
}
}
}
public class myException : ApplicationException
{
public myException(string msg, Exception e) : base(msg, e) { }
}
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
Groupdocs.Web.UI.Viewer.InitRoutes();
Groupdocs.Web.UI.Viewer.SetRootStoragePath(docLocation);
Groupdocs.Web.UI.Viewer.SetLicensePath(Server.MapPath("~/Licenses/GroupDocs.Viewer.lic"));
Groupdocs.Web.UI.Viewer.EnableFileListRequestHandling(true);
Groupdocs.Web.UI.Viewer.ShowExceptionDetailsOnClient(showError);
if (!String.IsNullOrEmpty(docLog))
Groupdocs.Web.UI.Viewer.SetLogFilePath(docLog);
Groupdocs.Web.UI.Viewer.Subscribe(new DocumentOpenSubscriber());
RegisterRoutes(RouteTable.Routes);
}
Can you please help?
I am using
VS 2012,
Groupdocs.Viewer.dll v. 2.14.0.0
MVC 4
.NET v4.5
IIS 8.5
Hello Deric,
Hello Pavel,
I have moved the code in controller, but it is still not working (https://drive.google.com/file/d/0ByZC1UqGlDWbVFZTZ05WdXVBNjg/view?usp=sharing).
Attached is displayed error from this project, when extension is not supported.
Can you please take a look how to customize this message?
Thank you!
Hello Denic,
Hello Pavel,
Thank you for investigating!
Do you have any workarounds for this problem, for example to hide the error text completely from screen?
Also please let me know if this enhancement might be included in future plugin versions.
Hi again,
Ok, I can confirm that workaround is working as you described. Thank you!
Hi Denic,