mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-14 22:37:13 +00:00
Introduce JSON parse utility function with error handling (#6401)
* Introduce JSON parse utility function with error handling Fixes #6400 * Fix typo
This commit is contained in:
@@ -58,7 +58,7 @@ GitLabSaver.prototype.save = function(text,method,callback) {
|
||||
}
|
||||
var requestType = "POST";
|
||||
if(xhr.status !== 404) {
|
||||
getResponseData = JSON.parse(getResponseDataJson);
|
||||
getResponseData = $tw.utils.parseJSONSafe(getResponseDataJson);
|
||||
$tw.utils.each(getResponseData,function(details) {
|
||||
if(details.name === filename) {
|
||||
requestType = "PUT";
|
||||
@@ -82,7 +82,7 @@ GitLabSaver.prototype.save = function(text,method,callback) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
var putResponseData = JSON.parse(putResponseDataJson);
|
||||
var putResponseData = $tw.utils.parseJSONSafe(putResponseDataJson);
|
||||
callback(null);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user