How to get Error Message from previous connector Logic App - error-handling

Is it possible to get and insert the previous connector's error message in a connector that gets triggered on failed after, to log the error message?
I did a seach and tested something like: #{body('XML_Validation')['message']}.
If so, is it also possible to get the Error code for the failed connector?
-----UPDATE-----
Ok so the previous test of #{body('XML_Validation')['message']} works on some connectors but not XML-Validation.
Is it still possible to extract the error message / exception somehow?
this is what i watch to get as a message to implement in another logic app:

Every action following the trigger-event can run under specific conditions. Defined like this in the code view:
"runAfter": {
"PreviousAction": [
"Succeeded"
]
}
You could set the "runAfter" to run on "Failed" and capture the message this way.
Have a look at: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-exception-handling

Building on Steven's comment from the accepted answer, in my case I used the following:
#actions('Add_registrant_to_GoToWebinar')['outputs']['statusCode']
It allows to get the statusCode from the raw output of the connector, because this connector does not expose it.

Related

Counting the number of response codes in JMeter 4.0

I run some load tests (all endpoints) and we do have a known issue in our code: if multiple POST requests are sent in the same time we do get a duplicate error based on a timestamp field in our database.
All I want to do is to count timeouts (based on the message received "Service is not available. Request timeout") in a variable and accept this as a normal behavior (don't fail the tests).
For now I've added a Response Assertion for this (in order to keep the tests running) but I cannot tell if or how many timeout actually happen.
How can I count this?
Thank you
I would recommend doing this as follows:
Add JSR223 Listener to your Test Plan
Put the following code into "Script" area:
if (prev.getResponseDataAsString().contains('Service is not available. Request timeout')) {
prev.setSampleLabel('False negative')
}
That's it, if sampler will contain Service is not available. Request timeout in the response body - JMeter will change its title to False negative.
You can even mark it as passed by adding prev.setSuccessful(false) line to your script. See Apache Groovy - Why and How You Should Use It article fore more information on what else you can do with Groovy in JMeter tests
If you just need to find out the count based on the response message then you can save the performance results in a csv file using simple data writer (configure for csv only) and then filter csv based on the response message to get the required count. Or you can use Display only "errors" option to get all the errors and then filter out based on the expected error message.
If you need to find out at the runtime then you can use aggregate report listener and use "Errors" checkbox to get the count of failure but this will include other failures also.
But, if you need to get the count at the run time to use it later then it is a different case. I am assuming that it is not the case.
Thanks,

Can BigQuery report mismatched the schema field?

When I upsert a row that mismatches schema I get a PartialFailureError along with a message, e.g.:
[ { errors:
[ { message: 'Repeated record added outside of an array.',
reason: 'invalid' } ],
...
]
However for large rows this isn't sufficient, because I have no idea which field is the one creating the error. The bq command does report the malformed field.
Is there either a way to configure or access name of the offending field, or can this be added to the API endpoint?
Please see this Github Issue: https://github.com/googleapis/nodejs-bigquery/issues/70 . Apparently node.js client library is not getting the location field from the API so it's not able to return it to the caller.
Workaround that worked for me: I copied the JSON payload to my Postman client and manually sent a request to REST API (let me know if you need more details of how to do it).

Nest1.0: ConnectionStatus error handling

I have a question regarding to Nest1.0pr and the connection error handling. In the previous versions of Nest I was using IResponse.ConnectionStatus.Error. It seems to me that the property Error does not exist in the new version anymore. However in the documentation I found the following:
ConnectionStatus is the response as it was returned by
Elasticsearch.net. It's section on handling responses applies here as
well.
And in the very section the property Error is mentioned.
Error When a call succeeds but does not return a http status code of
200 this property will have details on the error. Read more about
error handling here
So is the recommended way to check whether the property Success is false?
TIA
This changed when NEST was refactored to use Elasticsearch.Net. Now when a request fails, you can try checking the IResponse.ConnectionStatus.OriginalException property, which will contain the actual Elasticsearch error.

How to get SimplePie to fail gracefully on invalid feed?

I'm trying to get SimplePie to fail gracefully if one of the feeds I hand it turns out to be unavailable or invalid (due to server issues on the feed provider's end)
The code I've got is this:
$this->feed= new SimplePie();
// Set which feed to process.
$this->feed->set_feed_url('http://my_feed_goes_here'); // Bogus
$this->feed->handle_content_type();
// Run SimplePie.
$this->feed->init();
The problem is, if the feed_url turns out to be invalid, I get the following error as soon as it hits $this->feed->init();
Fatal error: Call to undefined method DOMElement::getLineNo()
I've looked through the documentation, and I can't see anything about validating. I did see this page about error checking (http://simplepie.org/wiki/reference/simplepie/error) but that only really works if the URL is completely invalid and fails to load. In a case where the URL comes back with a 404, or something else that is not a valid feed, $feed->error is blank.
Isn't there some mechanism built into SimplePie to allow me to see whether I got a valid feed back, so I can fail gracefully if I didn't?
In SimplePie 1.3.1, ->init() will return false if it can't read or parse the URL, so you might do this:
if (! $feed->init()) {
// log your error, "return false" or handle the failure some other way
}
Based on my reading of simplepie\library\SimplePie.php, it doesn't generate any exceptions and that's why Try/Catch won't work.
This may not be built into SimplePie, but in your calling PHP you could use a try/catch block:
try {
$this->feed->init();
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
Although depending on the error, this might not work either.

Flurry Event API not returning event parameter values

I have been trying to use the EventMerics API to return detailed event parameter data.
I have setup a test application and have uploaded event data with parameters, I can see the data in the web interface.
However the API doesn't seem to return the parameter data as stated by the documentation.
The following call
http://api.flurry.com/eventMetrics/Event?apiAccessCode=xxx&apiKey=xxx&startDate=2012-08-27&endDate=2012-08-27&eventName=heatmap%20-%20iPhone-Title-all
returns:
<eventMetrics type="Event" startDate="2012-08-27" eventName="heatmap - iPhone-Title-all" endDate="2012-08-27" version="1.0" generatedDate="8/27/12 10:45 PM">
<day uniqueUsers="2" totalSessions="12" totalCount="14" date="2012-08-27"/>
<parameters/>
</eventMetrics>
....
The parameters section is empty, I am expecting the following parameter values:
{touchXY : 299,465,2012-08-27 16:40:15 +0100}
{touchXY : 301,461,2012-08-27 16:29:03 +0100}
{touchXY : 192,312,2012-08-27 16:22:54 +0100}
{touchXY : 254,461,2012-08-27 16:23:04 +0100}
Has anyone got parameter values to return via the Flurry REST API?
the API call used by you is correct. I would recommend you to write to support#flurry.com to investigate why this is not happening.
(Disclaimer: I work in the Support team at Flurry)
The event name in the request is case sensitive so you should check the way it's written on the site. I changed mine from "editor" to "Editor" and the problem resolved.