HTTP Proxy error response

Hello all,
I’m using the http proxy in Alumio but i’m struggling a bit with the response that it gives when something goes wrong with the connected system. Something that might be important to know is that this call is not being made by the proxy itself but in a http transformer inside a entity transformer since it needs to make a couple calls based on the data has been sent to the http proxy

In this case i make a call via the proxy to insert data but have some data that is not correct. In Alumio i see the following error:

{
  "error": {
    "code": "",
    "message": "An error has occurred.",
    "innererror": {
      "message": "Write failed for table row of type 'ReturnOrderHeaderV2Entity'. Infolog: Warning: The value '9999-99999' in field 'Customer account' is not found in the related table 'Customers'.; Warning: validateField failed on field 'ReturnOrderHeaderV2Entity.CustomerAccountNumber'.",
      "type": "Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataWriteException",
      "stacktrace": "   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.CreateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContext operationContext)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__2.MoveNext()"
    }
  }
}

however when calling the proxy the response you get with the same data is:

{
    "status": 400,
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Bad Request",
    "detail": "Internal Server Error"
}

Is there a way that i can get Alumio to response with the first message.

Thanks in advance.

Hi @jesse.wever

Could you please confirm whether the response status code from the connected system is not 2XX? If so, you can configure the HTTP client that does the call to not stop the process when it returns non-2xx responses. You can refer to the documentation below.

Hi @Gugi
The response is indeed a 400. however the problem here is not that it stops but that it doesn’t give the information in the 400 error to the external system calling Alumio.

I have tried setting it to not stop on 400 and then using a conditional transformer followed by an error transformer, but it seems the error transformer only does hardcoded output so that doesn’t give the end user much useful information

Thank you for clarifying. Could you please confirm whether you put the transformer in the Response processors?

No i didn’t, the reason is that the proxy needs to make multiple calls and the error is not happening in the proxy call so i didn’t think putting the transformer in the response would do what i wanted to.
The setup currently is:

{
	http proxy, call to get the end result

	request processor {
		execute entity transformer {
			http call to insert header data
			http call to insert rows data
		}
	}

	response processor {}
}

if i understand you correclty would you then do the following:

{
	http proxy, call to insert header data

	request processor {}

	response processor {
	http call to insert rows data
	}
}

You are correct. The request processor is unable to respond to the client as it is intended to modify the request to the connected system. Therefore, we recommend the latter implementation you mentioned above.

alright, thanks for the info. will try the coming week if that does what we want

Happy to help!

Sure thing. Feel free to let us know if you have further questions.

hi Gugi,
this was indeed the solution to my problem, thanks

Great to hear that it solved the problem.

I have quoted your solution to my reply above so that you can mark it as the solution.

Feel free to let us know if you have any other questions.