Enriching error objects with info for administator/developer
 
Forums / SmartComponent Library - Developer Forum / Enriching error objects with info for administator/developer

Enriching error objects with info for administator/developer

7 posts, 0 answered
  1. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    21 Jan 2021
    Link to this post
    Is there a way to add information to an error object that relevant to an application administrator / developer in a way that is not immediately shown to the enduser ?

    It could be shown in the call stack part of the message dialog.

    Use case : I created a FileNotFoundException and want to add current directory and propath info.

    I tried AddMessage to add additional messages but these are all shown directly to the enduser.

    I thought of some options

    • * modify the message dialog to only show the first message by default and add a button to display the extra info
    • * prefix the extra messages with "DEVINFO:" and move messages matching that pattern to the call stack part
    • * add an extra interface IHasAdminInistratorInfo or IExtraCallStackInfo to the error object and have the dialog detect and use that interface.
    If possible I'd like to use some prescribed way. I guess the last option is the cleanest one.
    Is this something that could be added to the framework or should we create our own dialog to achieve this ?
    Last modified on 21 Jan 2021 12:01 by Carl Verbiest
  2. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    21 Jan 2021 in reply to Carl Verbiest
    Link to this post
    i would not (ab)use the messages or the stack-trace for this.

    I would go with additional properties in your custom error class. Especially for really structured info like the "current directory".

    I believe you have customized the error message dialog - our error message dialog allows to show all (custom) properties of the currently shown error in a child dialog. It would certainly possible to show them in a similar way directly in the initial message dialog. 

    PROPATH and other session relevant info is by default part of the Consultingwerk.Exceptions.Exception class (the SystemInfo).
  3. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    21 Jan 2021 in reply to Mike Fechner
    Link to this post
    We use the "out-of-the-box" error message dialog, but with extra custom buttons.
    I'll try the extra properties approach
  4. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    21 Jan 2021 in reply to Carl Verbiest
    Link to this post
    Custom property works fine, see screenshot

    Thanks
  5. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    21 Jan 2021
    Link to this post
    :-)
  6. Carl Verbiest
    Carl Verbiest avatar
    59 posts
    Registered:
    12 Oct 2018
    21 Jan 2021 in reply to Mike Fechner
    Link to this post
    Any chance you'd make that property grid read-only editable so that we could copy values out of it ?
    I'd rather stick to using the default dialog.
  7. Mike Fechner
    Mike Fechner avatar
    319 posts
    Registered:
    14 Sep 2016
    22 Jan 2021 in reply to Carl Verbiest
    Link to this post
    It's a tree view - not a grid. 

    If you log an enhancement request, we can investigate.
7 posts, 0 answered