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
-
complain does three things:
- add an ErrorMessageBlock to the statusArea
- debug.log
- reject
-
https://github.com/solid/solid-ui/blob/master/src/authn/authn.ts#L229
- reject
-
status 401
-
status 403 cross-origin
- sets a variable on the context
- debug.warn
-
status 403 same-origin
- debug.warn
-
status 404
- triggers a confirm
- followed by either complain (not implemented yet)
- or reject
-
other stats
- alert
-
progressDisplay can stay in solid-ui
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
)
Doing this in https://github.com/solid/solid-ui/pull/359