2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-02 07:34:28 -06:00

Log errors to console.error

This commit is contained in:
Jeroen Akkerman 2019-07-18 14:46:08 +02:00
parent 0558fb0d68
commit 63a1825b6e

View File

@ -2029,7 +2029,7 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
try {
var response = JSON.parse(this.responseText);
} catch (error) {
console.log('EasyMDE: The server did not return a valid json.');
console.error('EasyMDE: The server did not return a valid json.');
onErrorSup(fillErrorMessage(self.options.errorMessages.importError));
return;
}
@ -2041,7 +2041,7 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
} else if (response.error) { // server side generated error message
onErrorSup(fillErrorMessage(response.error));
} else { //unknown error
console.log('EasyMDE: Received an unexpected response after uploading the image.'
console.error('EasyMDE: Received an unexpected response after uploading the image.'
+ this.status + ' (' + this.statusText + ')');
onErrorSup(fillErrorMessage(self.options.errorMessages.importError));
}
@ -2049,7 +2049,7 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
};
request.onerror = function (event) {
console.log('EasyMDE: An unexpected error occurred when trying to upload the image.'
console.error('EasyMDE: An unexpected error occurred when trying to upload the image.'
+ event.target.status + ' (' + event.target.statusText + ')');
onErrorSup(self.options.errorMessages.importError);
};