Closed jeffggardner closed 5 years ago
Hi @jeffggardner !
If a function is handling an error, IOpipe doesn't consider that to be an error as such. If, on the other hand, a request generated an unhandled error state, that would be flagged as an error in your dashboard.
What I’d suggest is that if you want to log handled errors, you could do that with a custom label in your error handler function.
Hi @mrickard I understand. However if you are using the API Gateway "Lambda Proxy Integration" the response from the lambda must be in a very specific format.
So throwing the error will break the proxy integration and the API Gateway will return an HTTP 200 in those cases.
And looking further, I think that you would have to modify this file: https://github.com/iopipe/iopipe-js-core/blob/master/src/index.js#L232
in a way that inspects the statusCode
of the response where that value >= 400 and report that as an error
@mrickard I should probably open this issue on the iopipe-js-core repo
closing in favor of: https://github.com/iopipe/iopipe-js-core/issues/347
We use the Lambda proxy integration in AWS API Gateway and it seems that iopipe can't detect errors within our functions.
Due to the way that integration works our lambdas don't use things like
context.fail()
nor can we throw the error. Instead, the integration uses the JSON body to determine the response to the client; e.g:iopipe does not report this an error