TheCocoaProject / cordova-plugin-nativestorage

Cordova plugin: Native storage of variables in Android, iOS and Windows
http://thecocoaproject.github.io/
Apache License 2.0
292 stars 106 forks source link

Browser platform error object has wrong structure. #118

Open Emptyfruit opened 6 years ago

Emptyfruit commented 6 years ago

Ios or Android platform produce error object with structure as documented with code property that is a number. But in Browser platform code property is itself an object with the same structure as error, that is: code, source and exception. So in Browser i have to handle errors is such a manner:

if (error.code.code == 2) {...}

Plugin version: 2.3.1

Ionic info

cli packages: (/Users/Emptyfruit/dev/organizer/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : android 6.3.0 browser 5.0.1 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    ios-sim           : 5.0.13 
    Node              : v8.11.1
    npm               : 5.6.0 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.3.1 Build version 9E501 

Environment Variables:

    ANDROID_HOME : /Users/Emptyfruit/Library/Android/sdk

Misc:

    backend : pro
GillesC commented 6 years ago

issue related to #74.