-
Notifications
You must be signed in to change notification settings - Fork 185
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
Narrow errors for neo datetime #4875
Conversation
) -> Result<FixedDecimalFormatter, DataError> { | ||
FixedDecimalFormatter::try_new(locale, options).map_err(|e| match e { | ||
DecimalError::Data(e) => e, | ||
_ => unreachable!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this unreachable branch will disappear in 2.0, when the external constructor can return DataError
only. Similar below
@robertbastian Can you reference the corresponding issue in the OP? |
Done |
@@ -952,7 +994,7 @@ impl RawDateTimeNames { | |||
///// Textual symbols ///// | |||
FieldSymbol::Era => { | |||
self.load_year_names( | |||
year_provider.ok_or(Error::MissingNames(field))?, | |||
year_provider.ok_or(LoadError::MissingNames(field))?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: With the work I'm doing to consolidate the neo formatter types, this error case might go away which would be nice.
@robertbastian Also please link the issue about constructor errors, where we listed out the specific cases where returning DataError directly from constructors was acceptable |
Part of #4336
Per policy in #4638 (comment)