Skip to content

feat: Better error handling for 'native' plugins. #2443

Open
@TaaBooThree

Description

@TaaBooThree

Feature Request

Describe the Feature Request

Hey guys, we are running into issues when handling plugins on native devices.

For example the Geolocation.getCurrentLocation() function returns a different error object on web than it does on native devices.

The error object on this particular function on native devices currently only holds a message property. Without any documentation, it is hard to see what kind of errors it may throw and to write code around handling these errors.

The error object on web is the GeolocationPositionError. It's a lot easier to write different methods around the types of errors it can throw.

The same goes for other plugins like the Camera plugin.

Platform Support Requested

  • Android
  • iOS
  • Electron
  • Web

Describe Preferred Solution

The preferred solution would be a single error object that we can use to handle the error in the same way across platforms. It would also help to have documentation of the errors that certain functions throw. I currently have to search for the error types in the @capacitor/core package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions