My apologies. I didn't realise they would act differently.
So, to confirm, it should be like below now?
I tried that, and it made no difference.
Maybe the ASP.NET is the issue, and not what is being suggested?
My apologies. I didn't realise they would act differently.
So, to confirm, it should be like below now?
I tried that, and it made no difference.
Maybe the ASP.NET is the issue, and not what is being suggested?
I think it's better to call @patrick
@patrick, do you know why this might be an issue with ASP.NET? Are there any workarounds?
Thanks
Ray
ASP.NET handles errors a bit different, the error contains a lot more information and often the actual error cause is nested within the InnerException. We don't have a way to pick the different data from the error so you will need to write a custom expression for it. Best is to first just output the whole $_ERROR within the catch to see how the object is structured and then write the desired expression you need.
Does it return just the message if you use $_ERROR.orgException.InnerException.Message?
I can change the output for the errors, but often we'll need the extra information in it to find the actual code that triggered the error when there is some bug in the code.
hi hi.. i have the same question… im using PHP… Wappler 7.7.5
I have an “Import CSV“ action.. I have mapped all the fields.. and it works great if I upload a CSV that contains all the fields / data.. and it uploads with no problem….
But I want to return an error.. if the import did not work…
Say my client uploads a CSV with totally unrealated fields not mapped by mistake.. then i want to thow a error with the CATCH… but for some reason I cant get for the CATCH to work as its stuck with the TRY error..
eg.. my client uploads “monkey.csv” with say only 2 fields.. instead of stocklist.csv with 20 fields….
Then the response should show 500??
This is what i have can anybody please assist.. or im also being a monkey here… ![]()
So all these work if I upload a CSV containing the fields below…
But how do I “generate” an error if the CSV does not contain the correct data or fields
This is the response..
![]()
so instead of showing this.. it should go to the CATCH and response should be 500 with the error? Or am I approaching this the complete wrong way. Any help would be appreciated.. as its doing my head in.. im sure im doing something stupid here.. or not checking something.. so any advice would be awesome ![]()
@Mozzi This is how I approached it.
Ignore the what’s not relevant.
There is a lot of steps in my one, which I’m sure you can reduce.
Here’s the additional properties
Hopefully you can follow it. If not, drop me a DM and I will try to help you out.
Ray
Hi Ray.. thanks that is very detailed and impressive how you error checked evey field. Well done..
but that the question is… how do I get the error on the Import CSV step
All i want is.. if the CSV file does not match the “elements” for the import.. then it should not give me the error of what is below (*even if its the correct error, and its good to know why) .. but if the Import CSV File is within a TRY/CATCH… then it must take the error into account.. but then the CATCH must give me a response… i guess….
![]()
Im looking for a way.. so that IF there is a error.. that the response should be 500 with the catch.
so even before inserting or checking or setting set values.. i need to see if the CSV file at least matches the import request… if the CSV file does not contain the “mapped” elements then I need response 500.
As my CSV elements requires say 50 fields/elements.. but say the client loads the wrong CSV file with only 3 fields/elements.. then i dont want it to be stuck at the error above that stops all operations..… i want it to see that its an error and move over to the CATCH to generate the response 500.
Maybe the “import” check can updated so that it will allow the Response in the catch to happen?
Because if I do say.. use a Send Mail as example and its not correct … see sample .. I will get a Response 500 in the catch..
This is on purpose for this sample..
Because the Send Mail is failing the response is then 500
.bump.
.bump.
thank you Team ![]()