9 Replies Latest reply on Jan 3, 2019 2:24 PM by Ramesh Reddy

    How to handle the validation, exception and pass it to end user?

    Thirumaran PM Newbie

      I would like to handle the following items in my VDB and send the proper odata message to the end user (Salesforce)

      1. if there is no data found

      2. Timeout message

      3. Any error while processing the data

        • 1. Re: How to handle the validation, exception and pass it to end user?
          Ramesh Reddy Master

          There is no need or provision to handle this in the vdb. Odata already defines what response to send in those situations.

          1 of 1 people found this helpful
          • 2. Re: How to handle the validation, exception and pass it to end user?
            Thirumaran PM Newbie

            Thank you so much Ramesh. When the salesforce made the and  did not  find the data after longtime, The salesforce team was created a bug and saying that there was something wrong with my service. I dont know how to explian to them.

            • 3. Re: How to handle the validation, exception and pass it to end user?
              Ramesh Reddy Master

              All you can do is turn up the logging on your side and see what kind of request Salesforce is sending, and why it is taking more time or erroring? If that is a mistake on your service or Teiid's OData implementation you can open up an issue in Teiid's JIRA for fixes.

              • 4. Re: How to handle the validation, exception and pass it to end user?
                Thirumaran PM Newbie

                Thank you so much Ramesh.

                 

                Refer that following log from Salesforce PROD.

                 

                For that particular date range, there is no data and it coming as "responseStatusCode":200 and it is the successful response. I have a question, so which variable or keyword the sales force team has to look after any errored out or timedout or successful. Please have a look and advise.

                 

                 

                 

                11:18:44.348 (23350926177)|STATEMENT_EXECUTE|[74]

                11:18:44.348 (23350932841)|HEAP_ALLOCATE|[74]|Bytes:7

                11:18:44.348 (23350950903)|HEAP_ALLOCATE|[74]|Bytes:2

                11:18:44.348 (23350958045)|HEAP_ALLOCATE|[74]|Bytes:9

                11:18:44.348 (23350965488)|USER_DEBUG|[74]|DEBUG|STATUS:OK

                11:18:44.348 (23350972374)|STATEMENT_EXECUTE|[75]

                11:18:44.348 (23350978410)|HEAP_ALLOCATE|[75]|Bytes:12

                11:18:44.348 (23351026030)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{"responseStatusCode":200}|0x2835856a

                11:18:44.348 (23351059367)|HEAP_ALLOCATE|[75]|Bytes:3

                11:18:44.348 (23351072163)|HEAP_ALLOCATE|[75]|Bytes:15

                11:18:44.348 (23351080399)|USER_DEBUG|[75]|DEBUG|STATUS_CODE:200

                11:18:44.348 (23351099998)|STATEMENT_EXECUTE|[77]

                11:18:44.348 (23351102345)|STATEMENT_EXECUTE|[78]

                11:18:44.348 (23351191368)|HEAP_ALLOCATE|[78]|Bytes:1824

                11:18:44.348 (23351205422)|VARIABLE_SCOPE_BEGIN|[78]|jsonReplacedString|String|false|false

                11:18:44.348 (23351243121)|VARIABLE_ASSIGNMENT|[78]|jsonReplacedString|"{\"@odata.context\":\"$ (1804 more) ..."

                11:18:44.348 (23351247672)|STATEMENT_EXECUTE|[79]

                11:18:44.348 (23351253046)|HEAP_ALLOCATE|[79]|Bytes:14

                11:18:44.348 (23351259122)|HEAP_ALLOCATE|[79]|Bytes:12

                11:18:44.348 (23351339947)|HEAP_ALLOCATE|[79]|Bytes:1822

                11:18:44.348 (23351352956)|HEAP_ALLOCATE|[79]|Bytes:15

                11:18:44.348 (23351359680)|HEAP_ALLOCATE|[79]|Bytes:13

                11:18:44.348 (23351388234)|HEAP_ALLOCATE|[79]|Bytes:1822

                11:18:44.348 (23351401651)|VARIABLE_ASSIGNMENT|[79]|jsonReplacedString|"{\"OdataContext\":\"$me (1802 more) ..."

                11:18:44.348 (23351406013)|STATEMENT_EXECUTE|[81]

                11:18:44.348 (23351409492)|HEAP_ALLOCATE|[81]|Bytes:43

                11:18:44.348 (23351560085)|HEAP_ALLOCATE|[81]|Bytes:27

                11:18:44.348 (23351643482)|SYSTEM_METHOD_ENTRY|[1]|Type.Type()

                11:18:44.348 (23351648168)|STATEMENT_EXECUTE|[1]

                11:18:44.348 (23351676537)|SYSTEM_METHOD_EXIT|[1]|Type

                11:18:44.348 (23351684300)|HEAP_ALLOCATE|[81]|Bytes:8

                11:18:44.348 (23351700312)|HEAP_ALLOCATE|[81]|Bytes:8

                11:18:44.348 (23351709735)|VARIABLE_SCOPE_BEGIN|[4]|this|System.Type|true|false

                11:18:44.348 (23351772956)|VARIABLE_ASSIGNMENT|[4]|this|{}|0x47cb0c8a

                11:18:44.348 (23351779784)|VARIABLE_SCOPE_BEGIN|[4]|apextype|java:common.apex.runtime.ApexObjectType|true|false

                11:18:44.348 (23351885714)|VARIABLE_ASSIGNMENT|[4]|apextype|"UtilityClsFeeAdjustments.ResponseWrappercls"|0x196f9ffb

                11:18:44.348 (23351927263)|HEAP_ALLOCATE|[81]|Bytes:8

                11:18:44.348 (23351965773)|HEAP_ALLOCATE|[81]|Bytes:24

                11:18:44.348 (23351976166)|SYSTEM_METHOD_ENTRY|[1]|JSON.JSON()

                11:18:44.348 (23351979784)|STATEMENT_EXECUTE|[1]

                11:18:44.348 (23351984156)|SYSTEM_METHOD_EXIT|[1]|JSON

                11:18:44.348 (23352025061)|METHOD_ENTRY|[81]||System.JSON.deserialize(String, System.Type)

                11:18:44.348 (23354301171)|METHOD_EXIT|[81]||System.JSON.deserialize(String, System.Type)

                11:18:44.348 (23354361310)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{"responseStatusCode":200}|0x2835856a

                11:18:44.348 (23354395237)|VARIABLE_ASSIGNMENT|[EXTERNAL]|value|{"odatacontext":"$metadata#merchantbi (13 more) ...","value":"0x20ddb630"}|0x45286597

                11:18:44.348 (23354407302)|VARIABLE_ASSIGNMENT|[126]|this.value|0x45286597|0x2835856a

                • 5. Re: How to handle the validation, exception and pass it to end user?
                  Thirumaran PM Newbie

                  Also, see the following things from log [Status=OK, StatusCode=200]

                   

                  Method=GET, External Credential Type=EXTERNAL, HTTP Header Authorization=Method: Basic - Authorization Credential Hash: -1670254963, Retry on 401=True]

                  11:18:44.347 (23347812897)|NAMED_CREDENTIAL_RESPONSE|[Name=Integration_Elavon_Rest_Service, Status Code=200]

                  11:18:44.348 (23348108482)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:2222

                  11:18:44.348 (23349731286)|CALLOUT_RESPONSE|[71]|System.HttpResponse[Status=OK, StatusCode=200]

                  11:18:44.348 (23349752257)|HEAP_ALLOCATE|[71]|Bytes:1830

                  11:18:44.348 (23350135621)|VARIABLE_ASSIGNMENT|[71]|res|"System.HttpResponse[Status=OK, StatusCode=200]"|0x3099672f

                  11:18:44.348 (23350149647)|STATEMENT_EXECUTE|[72]

                  11:18:44.348 (23350637714)|VARIABLE_ASSIGNMENT|[EXTERNAL]|this|{}|0x2835856a

                  11:18:44.348 (23350656738)|VARIABLE_ASSIGNMENT|[EXTERNAL]|value|200

                  11:18:44.348 (23350666360)|HEAP_ALLOCATE|[125]|Bytes:4

                  11:18:44.348 (23350708218)|VARIABLE_ASSIGNMENT|[125]|this.responseStatusCode|200|0x2835856a

                  11:18:44.348 (23350721896)|STATEMENT_EXECUTE|[73]

                  11:18:44.348 (23350729568)|HEAP_ALLOCATE|[73]|Bytes:6

                  11:18:44.348 (23350839788)|HEAP_ALLOCATE|[73]|Bytes:1824

                  11:18:44.348 (23350854183)|HEAP_ALLOCATE|[73]|Bytes:1830

                  11:18:44.348 (23350898538)|USER_DEBUG|[73]|DEBUG|BODY: {"@odata.context":"$metadata#

                  • 6. Re: How to handle the validation, exception and pass it to end user?
                    Ramesh Reddy Master

                    I do not think I follow the above log is that some C/C++ program? When I said turn on the log, I meant on Teiid side to see what requests it is receiving. Note that an empty response with 200 is valid for some type of calls, like "select * from foo where x = y". I still do not understand where the salesforce is failing.

                    • 7. Re: How to handle the validation, exception and pass it to end user?
                      Thirumaran PM Newbie

                      It is not failing, the salesforce is not seeing any result and they are treating is an error from their point of view. I want to let them know how to capture the valid message.

                      • 9. Re: How to handle the validation, exception and pass it to end user?
                        Ramesh Reddy Master

                        A better explanation of what is the request SF sent and what is the expectation of result would be good. Then you can try locally and see if the Teiid is behaving to that expectations.