Generalize crash message for non-ok status. #9552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a macro and a function, generalizing the crash report on non-ok status. This should be used whenever a non-ok status represents an internal error, i.e. something that the user has no control over.
Key Changes:
OkOrDie()
function for crashing on non-ok status with source location informationXLA_CHECK_OK()
macro definition (moved to status.h), for callingOkOrDie()
with the appropriate source location_get_graph_hash()
implementation to callXLA_CHECK_OK()
instead of crafting a report withABSL_CHECK()
directly