我的git有问题,当我推动我的更改时,git向我发送了这个错误:
git FATAL: split conf set, gl-conf not present for "name of repository"
Run Code Online (Sandbox Code Playgroud)
我能做什么?或者我怎么能引起这个问题?谢谢你的帮助.
麦菲
我想为异常做一些处理程序.我在python中使用了Flask-restless和SQLAlchemy的组合.
我的问题:
当我向数据库中已存在的对象发送请求到api时,SQLAlchemy显示异常:
IntegrityError: (IntegrityError) column <column_name> is not unique u'INSERT INTO ...
Run Code Online (Sandbox Code Playgroud)
所以我尝试添加属性validation_exceptions
到create_api
方法:
manager.create_api( ... , validation_exceptions=[IntegrityError])
Run Code Online (Sandbox Code Playgroud)
但响应json包含:
{
"validation_errors": "Could not determine specific validation errors"
}
Run Code Online (Sandbox Code Playgroud)
和服务器api显示异常:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\flask_restless\views.py", line 797, in _extract_error_messages
left, right = str(exception).rsplit(':', 1)
ValueError: need more than 1 value to unpack
Run Code Online (Sandbox Code Playgroud)
Flask-restless中的异常验证不适用于此类异常(IntegrityError)
我该怎么办?是否有可能为异常创建一些处理程序并在json中返回我自己的错误消息?
python validation exception-handling flask-sqlalchemy flask-restless
如何处理来自商店或适配器的restAdapter错误?现在我正在使用此代码:
App.ApplicationRoute = Ember.Route.extend({
model: function(){
var self = this;
return this.store.find('item').then(function(data){
return data;
}, function (error){
console.log('error');
return [];
});
},
});
Run Code Online (Sandbox Code Playgroud)
更通用的东西会更好.谢谢