public IActionResult UpdateExistingProcessDocument([FromBody] UpdateProcessDataRequest updateRequest) { var isRequestValid = _updateValidator.Validate(updateRequest); if (isRequestValid.IsValid) { try { _logger.LogInformation($"Update ProcessData request for process ID {updateRequest.processRef}"); var result = _processDataUsecase.ExecuteUpdate(updateRequest); return(Ok(result)); } catch (DocumentNotFound ex) { return(StatusCode(200, $"Document with reference {updateRequest.processRef} was not found in the database." + $" An update is not possible on non-existent documents.")); } catch (Exception ex) { return(StatusCode(500, "An error has occured while processing the request - " + ex.Message + " " + ex.InnerException)); } } return(BadRequest(isRequestValid.Errors)); }