I'm a beginner in ETL, I'm tried to rest client API localhost:8080/student
(POST) from a existing data (eg: like 100k data)
In case of bad request API localhost:8080/student
(POST) returns response like this
{
"errors": [
{
"code": "student id.not.found",
"message": "student with branch id does not exist"
}
],
"statusCode": "BAD_REQUEST"
}
OR this in case of authorization fails
{
"error": "invalid_token",
"error_description": "Cannot convert access token to JSON"
}
what is the best way to handle this?
i want to save the failed request somewhere and retry later.
also in case of direct error like 500 etc how can i handle this?
my current approach is to store the JSON response in some variable and search if the response contain anything name with error or error code and i'll consider it fail or should i just check the return HTTP response status code
current flow going like this
rest response is like this
this is how i'm trying to get error field but it's coming null every time