mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-08 13:37:29 +01:00
Fixing a github alert (#2506)
* Fixing a github alert, plus converting a couple more JSON.stringify(error) instances to use stringifyError * Using manual concatenation
This commit is contained in:
@@ -115,7 +115,7 @@ export const getCopyJobs = async (): Promise<CopyJobType[]> => {
|
|||||||
});
|
});
|
||||||
return formattedJobs;
|
return formattedJobs;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorContent = JSON.stringify(error.content || error.message || error);
|
const errorContent = String(error.content || error.message || error);
|
||||||
if (errorContent.includes("signal is aborted without reason")) {
|
if (errorContent.includes("signal is aborted without reason")) {
|
||||||
throw {
|
throw {
|
||||||
message: "Previous copy job request was cancelled.",
|
message: "Previous copy job request was cancelled.",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { FeedOptions, ItemDefinition, QueryIterator, Resource } from "@azure/cosmos";
|
import { FeedOptions, ItemDefinition, QueryIterator, Resource } from "@azure/cosmos";
|
||||||
|
import { stringifyError } from "Common/stringifyError";
|
||||||
import * as Q from "q";
|
import * as Q from "q";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import LoadGraphIcon from "../../../../images/LoadGraph.png";
|
import LoadGraphIcon from "../../../../images/LoadGraph.png";
|
||||||
@@ -1092,8 +1093,8 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
|
|||||||
public static reportToConsole(type: ConsoleDataType, msg: string, ...errorData: any[]): void | (() => void) {
|
public static reportToConsole(type: ConsoleDataType, msg: string, ...errorData: any[]): void | (() => void) {
|
||||||
let errorDataStr = "";
|
let errorDataStr = "";
|
||||||
if (errorData && errorData.length > 0) {
|
if (errorData && errorData.length > 0) {
|
||||||
console.error(msg, errorData);
|
console.error(msg + String(errorData));
|
||||||
errorDataStr = ": " + JSON.stringify(errorData);
|
errorDataStr = ": " + stringifyError(errorData);
|
||||||
}
|
}
|
||||||
|
|
||||||
const consoleMessage = `${msg}${errorDataStr}`;
|
const consoleMessage = `${msg}${errorDataStr}`;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { AppState, epics as coreEpics, IContentProvider, reducers } from "@nteract/core";
|
import { AppState, epics as coreEpics, IContentProvider, reducers } from "@nteract/core";
|
||||||
import { configuration } from "@nteract/mythic-configuration";
|
import { configuration } from "@nteract/mythic-configuration";
|
||||||
import { makeConfigureStore } from "@nteract/myths";
|
import { makeConfigureStore } from "@nteract/myths";
|
||||||
|
import { stringifyError } from "Common/stringifyError";
|
||||||
import { AnyAction, compose, Dispatch, Middleware, MiddlewareAPI, Store } from "redux";
|
import { AnyAction, compose, Dispatch, Middleware, MiddlewareAPI, Store } from "redux";
|
||||||
import { Epic } from "redux-observable";
|
import { Epic } from "redux-observable";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
@@ -44,7 +45,7 @@ export default function configureStore(
|
|||||||
|
|
||||||
const traceFailure = (title: string, error: any) => {
|
const traceFailure = (title: string, error: any) => {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
onTraceFailure(title, `${error.message} ${JSON.stringify(error.stack)}`);
|
onTraceFailure(title, `${error.message} ${stringifyError(error.stack)}`);
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
onTraceFailure(title, error.message);
|
onTraceFailure(title, error.message);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { stringifyError } from "Common/stringifyError";
|
||||||
import * as DataTables from "datatables.net";
|
import * as DataTables from "datatables.net";
|
||||||
import * as ko from "knockout";
|
import * as ko from "knockout";
|
||||||
import Q from "q";
|
import Q from "q";
|
||||||
@@ -37,7 +38,7 @@ function parseError(err: any): ErrorDataModel[] {
|
|||||||
try {
|
try {
|
||||||
return _parse(err);
|
return _parse(err);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return [<ErrorDataModel>{ message: JSON.stringify(err) }];
|
return [<ErrorDataModel>{ message: stringifyError(err) }];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user