SolidOS/solid-logic

error handling

michielbdejong opened this issue · 4 comments

Looking at https://github.com/solid/solid-ui/blob/master/src/authn/authn.ts#L199 as an example.
There are a number of ways in which errors and exceptions are handled

I think solid-logic should just report what the error type was and not make a decision about whether or not that should be logged / shown / cause a reject

it now seems to work well for solidLogicSingleton.loadPreferences with custom error classes, but then loadIndex relies on context.preferencesFileError so that's logic depending on something that happens at the solid-ui layer

maybe I should just start with offering small functions that wrap up small kb-statements like

kb.each(
        me,
        ns.solid('privateTypeIndex'),
        undefined,
        context.preferencesFile
      )