Hi @Kothai Ramanathan ,
The error block looks good to me. In the main function, you can try the following. Thanks!
catch (Exception exception)
{
JObject error = new JObject();
error.Add("error", exception.Message);
log.LogError($"SelfServeProcess failed with an exception. Error: {exception.Message} StackTrace: {exception.StackTrace}");
return new BadRequestObjectResult(error);
}
----------
If the above response helps, please "accept as answer" and "up-vote" the same! Thanks!