export interface AjaxResponseException extends ResponseData {
exceptionID?: string;
+ exception?: string | null;
previous?: PreviousException[];
file?: string;
line?: number;
import { dialogFactory } from "../Component/Dialog";
import * as Core from "../Core";
import * as Language from "../Language";
+import { escapeHTML } from "../StringUtil";
type ErrorResponsePrevious = {
message: string;
type ErrorResponse = {
exceptionID?: string;
+ exception?: string | null;
file?: string;
line?: number;
message: string;
details += `<br><p>File:</p><p>${json.file} in line ${json.line}</p>`;
}
- if (json.stacktrace) {
+ if (json.exception) {
+ details += `<br>Exception: <div style="white-space: pre;">${escapeHTML(json.exception)}</div>`;
+ } else if (json.stacktrace) {
details += `<br><p>Stacktrace:</p><p>${json.stacktrace}</p>`;
} else if (json.exceptionID) {
details += `<br><p>Exception ID: <code>${json.exceptionID}</code></p>`;
import DomChangeListener from "../Dom/Change/Listener";
import * as Language from "../Language";
import { dialogFactory } from "../Component/Dialog";
+import { escapeHTML } from "../StringUtil";
let _didInit = false;
let _ignoreAllErrors = false;
details += `<br><p>File:</p><p>${data.file} in line ${data.line}</p>`;
}
- if (data.stacktrace) {
+ if (data.exception) {
+ details += `<br>Exception: <div style="white-space: pre;">${escapeHTML(data.exception)}</div>`;
+ } else if (data.stacktrace) {
details += `<br><p>Stacktrace:</p><p>${data.stacktrace}</p>`;
} else if (data.exceptionID) {
details += `<br><p>Exception ID: <code>${data.exceptionID}</code></p>`;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @since 5.5
*/
-define(["require", "exports", "tslib", "../Component/Dialog", "../Core", "../Language"], function (require, exports, tslib_1, Dialog_1, Core, Language) {
+define(["require", "exports", "tslib", "../Component/Dialog", "../Core", "../Language", "../StringUtil"], function (require, exports, tslib_1, Dialog_1, Core, Language, StringUtil_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerGlobalRejectionHandler = exports.InvalidJson = exports.ExpectedJson = exports.StatusNotOk = exports.ConnectionError = exports.ApiError = void 0;
if (json.file && json.line) {
details += `<br><p>File:</p><p>${json.file} in line ${json.line}</p>`;
}
- if (json.stacktrace) {
+ if (json.exception) {
+ details += `<br>Exception: <div style="white-space: pre;">${(0, StringUtil_1.escapeHTML)(json.exception)}</div>`;
+ }
+ else if (json.stacktrace) {
details += `<br><p>Stacktrace:</p><p>${json.stacktrace}</p>`;
}
else if (json.exceptionID) {
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/
-define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Listener", "../Language", "../Component/Dialog"], function (require, exports, tslib_1, AjaxStatus, Core, Listener_1, Language, Dialog_1) {
+define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Listener", "../Language", "../Component/Dialog", "../StringUtil"], function (require, exports, tslib_1, AjaxStatus, Core, Listener_1, Language, Dialog_1, StringUtil_1) {
"use strict";
AjaxStatus = tslib_1.__importStar(AjaxStatus);
Core = tslib_1.__importStar(Core);
if (data.file && data.line) {
details += `<br><p>File:</p><p>${data.file} in line ${data.line}</p>`;
}
- if (data.stacktrace) {
+ if (data.exception) {
+ details += `<br>Exception: <div style="white-space: pre;">${(0, StringUtil_1.escapeHTML)(data.exception)}</div>`;
+ }
+ else if (data.stacktrace) {
details += `<br><p>Stacktrace:</p><p>${data.stacktrace}</p>`;
}
else if (data.exceptionID) {