`createResource` does not catch falsy errors
Describe the bug
Like #1007, createResource also does not correctly handle falsy errors.
Your Example Website or App
https://playground.solidjs.com/?hash=-1153565294&version=1.4.1
Steps to Reproduce the Bug or Issue
Expected behavior
Falsy errors should still be errors.
Screenshots or Videos
No response
Platform
- OS: Windows 10 21H1
- Browser: Firefox
- Version: 100.0.2
Additional context
FWIW #945 can be implemented in a non-breaking way if resource.error is always a truthy type when there is an error (e.g. by wrapping non-errors in errors).
Dealing with undefined errors is a mess. And incredibly error prone since it involves proxying a placeholder around. We are going to take a different path. We will cast undefined and falsy errors to Errors and leave it like that. After going down a rabbit hole this is just not worth trying to make work. createResource will be handled the same.