Skip to content

Not catching errors at all. #95

@kvedantmahajan

Description

@kvedantmahajan

Stack - React 16.2.0 with webpack 3
npm install checkit

usage -

import Checkit from 'checkit'; import { CheckitRules } from '../../_helpers/checkit/campaign';

Campaign Rules below as defined in '../../_helpers/checkit/campaign';

var CheckitRules = new Checkit({ name: 'required', type: 'required', audience_list_id: 'required' }, { labels: { name: 'name', type: 'type', audience_list_id: 'audience_list_id' } });

var payload = { name: campaign_name || 'test', type: campaign_type || 'regular', audience_list_id: audience_list_id }

CheckitRules.run(payload).then(function(validated) { console.log(validated); }).catch(Checkit.Error, function(err) { console.log(err.toJSON()); });

As soon as I any empty value on payload it doesn't catch error. The success function is working fine if I make sure to populate every value.

This is surprising !

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