1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

All: Resolves #5754: Improved error message when synchronising with Joplin Server

This commit is contained in:
Laurent Cozic
2021-11-19 11:26:01 +00:00
parent c0b76cbd55
commit 0ec0d87e71
9 changed files with 128 additions and 49 deletions

View File

@@ -5,6 +5,7 @@ import JoplinError from './JoplinError';
import { Env } from './models/Setting';
import Logger from './Logger';
import personalizedUserContentBaseUrl from './services/joplinServer/personalizedUserContentBaseUrl';
import { getHttpStatusMessage } from './net-utils';
const { stringify } = require('query-string');
const logger = Logger.create('JoplinServerApi');
@@ -245,7 +246,7 @@ export default class JoplinServerApi {
// <hr><center>nginx/1.18.0 (Ubuntu)</center>
// </body>
// </html>
throw newError(`Unknown error: ${shortResponseText()}`, response.status);
throw newError(`Error ${response.status} ${getHttpStatusMessage(response.status)}: ${shortResponseText()}`, response.status);
}
if (options.responseFormat === 'text') return responseText;