1
幾個小時前,我所有的解析函數都返回無效的json。與雲代碼無關......我甚至試着回滾。我在Android平臺上,並沒有作出任何破壞遊戲改變它..解析函數突然返回無效json
例如, 我有一個登錄功能...
Parse.Cloud.define("loginuser", function(request, response){
var useremail = request.params.useremail;
var userpassword = request.params.userpassword;
var usersource = request.params.usersource;
Parse.User.logIn(useremail, userpassword,{
success:function(user){
// Sets either candidate or business to be true depending on condition
if (usersource == "candidate"){
user.set("candidate", true);
} else if (usersource == "business"){
user.set("business", true);
}
user.save(null, {
// login success & return
success: function(user){
response.success(user);
}, error: function(error){
response.error(error);
}
});
},
error:function(user, error){
// login failure
response.error(user, error);
}
});
});
在不改變它..它突然開始拋出錯誤:
01-05 22:37:30.175 1052-1052/recruitr.recruitr E/Login error: com.parse.ParseRequest$ParseRequestException: bad json response
01-05 22:37:46.045 1052-1052/recruitr.recruitr E/Signup Error: com.parse.ParseRequest$ParseRequestException: bad json response
有誰知道爲什麼?
編輯:
冉調試器,它會彈出該出來的時候,錯誤信息顯示出來:
this = {[email protected]}
cancel = {boolean[1]@4623}
logincredentials = {[email protected]} size = 3
parseUser = null
e = {[email protected]} "com.parse.ParseRequest$ParseRequestException: bad json response"
isPermanentFailure = false
code = 100
cause = {[email protected]} "org.json.JSONException: Value <html> of type java.lang.String cannot be converted to JSONObject"
cause = {[email protected]} "org.json.JSONException: Value <html> of type java.lang.String cannot be converted to JSONObject"
detailMessage = {[email protected]} "Value <html> of type java.lang.String cannot be converted to JSONObject"
stackState = {long[34]@4639}
stackTrace = {StackTraceElement[0]@4633}
suppressedExceptions = {[email protected]} size = 0
shadow$_klass_ = {[email protected]} "class org.json.JSONException"
shadow$_monitor_ = -1960135782
detailMessage = {[email protected]} "bad json response"
stackState = {long[30]@4632}
stackTrace = {StackTraceElement[0]@4633}
suppressedExceptions = {[email protected]} size = 0
shadow$_klass_ = {[email protected]} "class com.parse.ParseRequest$ParseRequestException"
shadow$_monitor_ = -2123277170
你可以看到,使用開發工具網絡選項卡,原始json數據? –
不,看到更新...我看到錯誤代碼100.根據解析網站http://parse.com/docs/dotnet/api/html/T_Parse_ParseException_ErrorCode.htm 100意味着連接失敗......但是它失敗在我的手機上。它可以解析有問題嗎?但是,我的其他應用程序沒有問題... – lawonga