atomic-data-browser icon indicating copy to clipboard operation
atomic-data-browser copied to clipboard

Wrong datatype error handling

Open joepio opened this issue 4 years ago • 1 comments

If a user changes the datatype for a property, the app can currently crash. The error should be handled more elegantly. Ideally, the user should be able to edit the wrong value.

joepio avatar Aug 30 '21 13:08 joepio

We can handle this in three places:

Handle in final view

Which means in every input component, every show component...

Handle in hook

I either have to handle errors explicitly everywhere, or handle them in the useArray / useString hook. If we handle the error in the hook, we can pass a null / empty array. The error can appear in the console.

Handle in toArray()

We can add an argument to toArray to have some default value instead of throwing to prevent errors runtime.

joepio avatar Aug 30 '21 13:08 joepio