1
Can i change the error message in a Failed Event Dialog?
Question asked by Richard Spinks - 3/1/2025 at 3:14 AM
Answered
DocumentUltimate Version 7.3.3

I am setting debugMode to false, however, the error message that is displayed still shows detailed information of the problem to the end user. Is it possible to override this error message? If not, is it possible to disable the dialog and then manually handle it in the failed client event?


1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Answer
Good catch, we have a fix for the behaviour and also a solution for manually handling the error:

Version 7.3.4 - March 3, 2025

  • Fixed: documentViewer.DebugMode property was not being respected on the client side.
    This property by default is false (unless you have the source code and compiled GleamTech.Common.dll with Debug configuration).
    So by default, error details should not be shown on DocumentViewer's error dialog.
    Although error details were reduced on the server, the details text box was still being shown.
    Also from now on, this property will also effect client-side errors, for example no details should be shown on local PDF opening errors.

    If you explictly set this property to true, it will show details in text box in the addition to the main message on error dialog.
    This can be useful for debugging purpose. This was the default behavior before v1.6.2:

  • Improved: Client side event can now be canceled via e.preventDefault() to suppress showing default error dialog.
    For example, e.detail.message can be examined and a custom message can be shown via documentViewer._showError() method.

    C#
    documentViewer.ClientEvents.Failed = "documentViewerFailed";

    On client-side:

    JavaScript
    function documentViewerFailed(e) {
        var documentViewer = e.target;
    
        if (e.detail.message == "some specific message") {
            //Canceling this event, to suppress showing error dialog with default error message.
            e.preventDefault();
    
            //Show your custom message with error dialog
            documentViewer._showError("customMessage");
    
            //Or write to browser console
            console.log("customMessage");
        }
    }

Reply to Thread