Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update $convert-data error log #3859

Merged
merged 3 commits into from
May 17, 2024
Merged

Conversation

pallar-ms
Copy link
Contributor

@pallar-ms pallar-ms commented May 15, 2024

Description

Update $convert-data error log. Currently, the entire exception is logged in some cases (except post processing exceptions) which might not be ideal in case the message has text from the input data being processed.
Updating the log to only mention exception type, FHIRConverterErrorCode and stack trace.

Related issues

Addresses AB#120207.

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@pallar-ms pallar-ms added the Bug Bug bug bug. label May 15, 2024
@pallar-ms pallar-ms requested review from dustinburson and wi-y May 15, 2024 15:28
@pallar-ms pallar-ms requested a review from a team as a code owner May 15, 2024 15:28
_logger.LogInformation(convertException, "Convert data failed.");
}

_logger.LogError($"Convert data failed. An exception of type {convertException.GetType()} occurred with error code - {convertException.FhirConverterErrorCode}. {convertException.StackTrace}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing we are losing is the an explicit message that the error occurred during post processing. We should be able to infer that from the stack trace but it may still be nice to include a post processing indicator in the log for clarity.

Copy link
Contributor Author

@pallar-ms pallar-ms May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type already has that information.
e.g. of how it was logged - An exception of type Microsoft.Health.Fhir.Liquid.Converter.Exceptions.PostprocessException occurred during postprocessing.

Yeah if we have derived classes for PostProcessException later (we don't have any now so we throw this type itself), then yes this would make sense, but that is also why I added the FhirConverterErrorCode as that is meant to give more granular nsights on when/what error caused this exception. So I feel that should lead us to the exact point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I can also add that check if we feel the exception type is not enough to indicate that.

dustinburson
dustinburson previously approved these changes May 15, 2024
@pallar-ms pallar-ms added the Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs label May 15, 2024
@pallar-ms pallar-ms added this to the S141 milestone May 15, 2024
wi-y
wi-y previously approved these changes May 15, 2024
@pallar-ms pallar-ms dismissed stale reviews from wi-y and dustinburson via 2ad8c9c May 15, 2024 18:35
Copy link
Collaborator

@LTA-Thinking LTA-Thinking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to lift FHIR Owner's block.

@pallar-ms
Copy link
Contributor Author

@LTA-Thinking , thanks for taking a look. Question - the PR build & deploy seems to be failing at an unrelated change to this PR, and I am also seeing other PRs blocked by the same error. Do you know if anyone is taking a look into that? What is the best place to bring this up and track status?

@pallar-ms pallar-ms merged commit 81cd22e into main May 17, 2024
47 checks passed
@pallar-ms pallar-ms deleted the personal/pallar/convertdata-logerror branch May 17, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants