InvokeTaskAsync
 

InvokeTaskAsync

3 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    25 Jan 2021
    Link to this post
    When using the InokeTaskAsync how can you trap any error thrown from the backend. For example, I am using the method below and when the method is called it always say compete with no errors even if an error is being thrown from the backend.
    Is there a different way to do this?

    METHOD PUBLIC VOID AsyncTaskCompletedHandler( sender AS Progress.Lang.Object,
                                                      e AS AsyncTaskCompletedEventArgs
                                                     ):
                                                     
    DEFINE VARIABLE iErrorAS Progress.Lang.Error NO-UNDO.                                                 
                                                     
    DO ON ERROR UNDO, THROW:

    MESSAGE 
    "Cancelled=" e:RequestHandle:Cancelled  SKIP 
    "Complete=" e:RequestHandle:Complete  SKIP
    "Error=" e:RequestHandle:Error  SKIP 
    "VALID-OBJECT(e:RequestHandle:ERROR-OBJECT)=" VALID-OBJECT(e:RequestHandle:ERROR-OBJECT)

    VIEW-AS ALERT-BOX.  
     

    IF VALID-OBJECT(e:RequestHandle:ERROR-OBJECT) THEN 
    DO:
        iError = CAST (e:RequestHandle:ERROR-OBJECT, Progress.Lang.Error).
        MESSAGE iError:GetMessage(1) VIEW-AS ALERT-BOX.  
    END. 
     
     

    END.   

    RETURN.


    END METHOD.
  2. Mike Fechner
    Mike Fechner avatar
    342 posts
    Registered:
    14 Sep 2016
    28 Jan 2021 in reply to Roger Blanchard
    Link to this post
    We may have to investigate this. 

    The proSIinvokeTaskAsync.p procedure catches the errors on the AppServer and just logs them to the AppServer log. They are not thrown to the client. 

    There may have been issues with errors thrown back from async procedure calls in the past. 

    If you rely on this feature, please log this as a bug. Please include descriptions of typical errors you'd expect to be returned. 
  3. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    12 Feb 2021 in reply to Mike Fechner
    Link to this post
    okay, thanks.
3 posts, 0 answered