DataAdminErrorHanlder

Posted by Roger Blanchard on 04-Oct-2018 07:00

We are using the following to catch any error while applying a schema update. Is there any way to retrieve the text of the error as well so I can write to my application log file?

DO ON ERROR UNDO, THROW:
 
    CREATE ALIAS DICTDB FOR DATABASE histlog.
 
    oService = NEW DataAdminService ("histlog"). /* HISTLOG DB */
    oService:LoadSchemaChanges(cHistlogDf).
 
    CATCH e AS Progress.Lang.Error:
  
        oErrorhandler = NEW DataAdminErrorHandler(). 
        oErrorHandler:Error(e). // will display error in message box
     
        DELETE OBJECT e NO-ERROR.
     
     END CATCH.
 
    FINALLY:
        DELETE OBJECT oService NO-ERROR.
        DELETE ALIAS DICTDB.    
    END FINALLY.
 
END.

Posted by Mike Fechner on 04-Oct-2018 08:06

Roger, since you're using the SmartComponent Library you can also do

CATCH err AS Progress.Lang.Error:

   Consultingwerk.Util.ErrorHelper:ShowErrorMessage (err) . /* gui for .net */

END CATCH.

or

CATCH err AS Progress.Lang.Error:

   Consultingwerk.Util.ErrorHelper:ShowErrorMessageBox (err) . /* classic ABL gui */

END CATCH.

Posted by James Palmer on 04-Oct-2018 07:21

The Progress.Lang.Error object has a method GetMessage(index). Is that what you're after?

Posted by goo on 04-Oct-2018 07:20

CATCH e AS Progress.Lang.Error:
  
        oErrorhandler = NEW DataAdminErrorHandler(). 
        oErrorHandler:Error(e:getmessage(1)). // will display error in message box
          
     END CATCH.

 

All Replies

Posted by goo on 04-Oct-2018 07:20

CATCH e AS Progress.Lang.Error:
  
        oErrorhandler = NEW DataAdminErrorHandler(). 
        oErrorHandler:Error(e:getmessage(1)). // will display error in message box
          
     END CATCH.

 

Posted by James Palmer on 04-Oct-2018 07:21

The Progress.Lang.Error object has a method GetMessage(index). Is that what you're after?

Posted by Mike Fechner on 04-Oct-2018 08:06

Roger, since you're using the SmartComponent Library you can also do

CATCH err AS Progress.Lang.Error:

   Consultingwerk.Util.ErrorHelper:ShowErrorMessage (err) . /* gui for .net */

END CATCH.

or

CATCH err AS Progress.Lang.Error:

   Consultingwerk.Util.ErrorHelper:ShowErrorMessageBox (err) . /* classic ABL gui */

END CATCH.

Posted by Roger Blanchard on 05-Oct-2018 07:21

Thanks everyone...I have what I need. Have a great weekend.

This thread is closed