[squeak-dev] The Inbox: System-ct.1161.mcz
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Jun 6 18:21:54 UTC 2020
I wonder anyway why InvalidDirectoryError & Co. override #defaultAction ...
If they are serious errors, they should show up a debugger via UndefinedError but not silently fix that anyhow by returning a default value, shouldn't they?
And if they are no serious errors, they should be Notifications IMO.
What do you think? :-)
Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Samstag, 6. Juni 2020 20:19:27
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: System-ct.1161.mcz
Christoph Thiede uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-ct.1161.mcz
==================== Summary ====================
Name: System-ct.1161
Author: ct
Time: 6 June 2020, 8:19:13.480392 pm
UUID: 173a90f3-4bb8-fc46-b5a6-6e4ab74e63ca
Ancestors: System-mt.1160
Catch all InvalidDirectoryErrors in GetTextTranslator availableLanguageLocaleIDs. Those exceptions are an implementation detail and may not confuse the caller. Such a confusion happened in connection with Morphic-ct.1638.
=============== Diff against System-mt.1160 ===============
Item was changed:
----- Method: GetTextTranslator class>>availableLanguageLocaleIDs (in category 'accessing') -----
availableLanguageLocaleIDs
"GetTextTranslator availableLanguageLocaleIDs"
| ids dirs localeDirForLang directoryNames |
ids := Set new.
dirs := Set new.
dirs addAll: LocaleDirsForDomain values.
dirs addAll: self defaultLocaleDirs.
+ [dirs do: [:dir |
- dirs do: [:dir |
| localesDir |
localesDir := FileDirectory on: dir.
+ directoryNames := localesDir directoryNames.
- directoryNames := [localesDir directoryNames] on: InvalidDirectoryError do: [:e | #()].
directoryNames
do: [:langDirName |
| localeID |
localeID := LocaleID posixName: langDirName.
localeDirForLang := localesDir directoryNamed: (self langDirNameForLocaleID: localeID).
localeDirForLang ifNotNil: [
(localeDirForLang fileNamesMatching: '*.mo') ifNotEmpty: [ids add: localeID]].
localeID hasParent ifTrue: [
localeDirForLang := localesDir directoryNamed: (self langDirNameForLocaleID: localeID parent).
localeDirForLang ifNotNil: [
(localeDirForLang fileNamesMatching: '*.mo') ifNotEmpty: [ids add: localeID parent]]].
].
+ ]] on: InvalidDirectoryError do: [:error | error resumeUnchecked: error defaultAction].
- ].
^ids!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/b7cc31d1/attachment.html>
More information about the Squeak-dev
mailing list
|