ajax调用无法获取错误

时间:2015-12-30 21:49:31

标签: jquery ajax

嘿我有一个我正在使用的ajax调用,它进入控制器并最终进行sql调用。我正在使用.success

的弃用版本
           $.ajax({
                type: "POST",
                url: "/group/create",
                data: postData,
                context: this
            }).success(function(msg) {
                if (msg.errors) {
                    //showCreateGroupErrors(msg.errors);
                    this.setState({
                        error: true,
                        errorMsg: msg.errors[0]
                    });

                } else {
                    //showCreateGroupSuccess("Group successfully created!");
                    this.props.addGroup(this.state.familyName);
                    this.props.update();
                }
            });

问题是每当我得到sql syntax error sql请求通过但我没有得到任何类型的错误或回调时间处理我可以通过控制台或任何东西锁定和打印。任何想法?

通常它将在上面的msg对象中携带,但在我的测试用例中它只是绕过.success函数。不知道最近发生了什么。

0 个答案:

没有答案
相关问题