[squeak-dev] The Inbox: System-ct.1161.mcz
Jakob Reschke
forums.jakob at resfarm.de
Sat Jun 6 18:54:42 UTC 2020
Errors are not resumable, although these errors with defaultActions
will resume with something if they do not signal another exception and
*if they are not handled*. If you turned this into a Notification, you
could resume it with another directory listing, but how much sense
would that make?
Am Sa., 6. Juni 2020 um 20:22 Uhr schrieb Thiede, Christoph
<Christoph.Thiede at student.hpi.uni-potsdam.de>:
>
> 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!
>
>
>
More information about the Squeak-dev
mailing list
|