Skip to content

Exception message review #7201

@ajcvickers

Description

@ajcvickers

Exception messages have not always evolved as behavior has evolved. Some exception messages are now wrong, while others are now unhelpful. Proposal:

  • Review with a group of people making sure that messages are correct and deciding what to add or remove from the message. Avoid wordsmithing as a team since this is painful and slow.
  • Focus on messages commonly seen and consider adding forward links.
  • One person (e.g. @rowanmiller @roji) goes through and writes the messages
  • PR review for tweaks

Updated process:

  • Each @dotnet/efteam person will go through messages that they understand and check for content based on the checklist below.
    • This should not include wordsmithing or items in the style checklist--these will be done by one person per assembly
    • Each resource should be marked appropriately in the spreadsheet attached to the Teams channel
  • Once this has been completed, we will go through the remaining resources (based on the spreadsheet) as a team

Content checklist:

  • Does the message say what went wrong?
  • Does it have a second sentence indicating what to do about it?
  • Are we providing specific metadata names, ID values, etc. where helpful?
  • Does it expose sensitive data without sensitive data logging enabled?
  • Would a fwlink help?

Style checklist:

  • Use {entityType}.{property/navigation}' rather than '{property/navigation}' of entity type '{entityType}'. Note that this will change the order of parameters, and so call sites will need to be updated.
  • Specify attributes without single quotes and with the square brackets @smitpatel
  • Be consistent about OnModelCreating as the terminology for fluent API @AndriySvyryd
  • Use "navigation" rather than "navigation property" @AndriySvyryd
  • Check usage of {foreignKey} and for correct quoting and use foreignKeyProperties where appropriate @AndriySvyryd
  • Grammar, punctuation and casing @roji
  • Be consistent about methods being formatted as 'Method' @roji
  • Be consistent about types being formatted as 'Type'
  • Make sure all "non blah" are spelled "non-blah" @roji
  • Use "Entity Framework" when referring to EF @roji done @smitpatel
  • Consistently use "context instance" instead of "context" or "DbContext" @roji
  • Weak entity types should be referred to as entity types with a defining navigation @roji
  • Shared entity types should be referred to as shared-type entity types @roji
  • Is this still relevant? - "For ASP.NET WebForms bind to 'DbSet.ToList' or use Model Binding." @ajcvickers
  • Replace "please report it" with "file an issue" and a fwlink to new issue @smitpatel
  • Discuss whether null should be quoted and when (Exception message review #22519 (comment))

See also #22309, #22308, #22374

Specific messages to investigate:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions