-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
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 useforeignKeyPropertieswhere 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
@rojidone @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:
- AnnotationNotFound - Can we use ToString or something similar to show the name of the object it was not found on? @AndriySvyryd
- CanConnectNotImplemented - Obsolete @roji
- AttemptToCreateEntityTypeBasedOnProxyClass Investigate what this means and try to be helpful. @smitpatel
- BadFilterDerivedType - Specify the root type @AndriySvyryd
- CannotConvertQueryableToEnumerableMethod - Consider adding some text indicating that this should never be hit @smitpatel
- NullTypeMappingInSqlTree should include the expression @smitpatel
-
CircularDependency consider adding a fwlink to a docs pageDocument how circular dependency in data can be resolved EntityFramework.Docs#2619 - PoolingContextCtorError (Improve exception message: The DbContext of type cannot be pooled because it does not have a single public constructor #18573) @AndriySvyryd
- ConflictingForeignKeyAttributes can be obsoleted @AndriySvyryd
- DuplicateAnnotation - add ToString of annotatable @AndriySvyryd
- DuplicatePropertyInList - split into separate messages for each use case @AndriySvyryd
- ConverterBadType - Add quotes to the items in {allowed} @smitpatel
- DbSetIncorrectGenericType - review whether the passed in names make sense and correspond to the name used in the DbSet constructor @smitpatel
- EntityEqualityOnKeylessEntityNotSupported - specify operator @smitpatel
- EntityEqualitySubqueryWithCompositeKeyNotSupported - specify operator, add documenation on how to rewrite and add fwlink @smitpatel
- ErrorMaterializingValueInvalidCast, ErrorMaterializingValueNullReference - move to Relational @smitpatel
- EntityRequiresKey - add fwlink to keyless docs @smitpatel
- ConverterBadType - Add quotes to the items in {allowed} @smitpatel
- DuplicatePropertiesOnBase - consider rewording @roji
AndriySvyryd