Skip to content

How to catch errors in async persistence adapter registration #1432

@morgs32

Description

@morgs32
  • I'm using the OPFS adapter.
  • And I'm getting this error:
Failed to execute 'getFileHandle' on 'FileSystemDirectoryHandle': Name is not allowed
  • I wonder if it's because I'm on localhost. I will try to repro on stackblitz

But regardless, I'd love to catch errors with adapters and then use a different adapter. Such as if we can't use OPFS I fallback to localstorage.

A catch here is that I like that new Collection is synchronous. Maybe in isReady() we could catch and substitute a different adapter? Hmm I feel like I need to think about this more...

Still worth creating this issue to discuss further? Happy to move to a discussion...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions