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:
vchske
2026-06-03 10:53:19 -07:00
committed by GitHub
parent e22a052d59
commit 4ad840c0c1
4 changed files with 8 additions and 5 deletions
@@ -115,7 +115,7 @@ export const getCopyJobs = async (): Promise<CopyJobType[]> => {
});
return formattedJobs;
} 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")) {
throw {
message: "Previous copy job request was cancelled.",
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { FeedOptions, ItemDefinition, QueryIterator, Resource } from "@azure/cosmos";
import { stringifyError } from "Common/stringifyError";
import * as Q from "q";
import * as React from "react";
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) {
let errorDataStr = "";
if (errorData && errorData.length > 0) {
console.error(msg, errorData);
errorDataStr = ": " + JSON.stringify(errorData);
console.error(msg + String(errorData));
errorDataStr = ": " + stringifyError(errorData);
}
const consoleMessage = `${msg}${errorDataStr}`;
@@ -1,6 +1,7 @@
import { AppState, epics as coreEpics, IContentProvider, reducers } from "@nteract/core";
import { configuration } from "@nteract/mythic-configuration";
import { makeConfigureStore } from "@nteract/myths";
import { stringifyError } from "Common/stringifyError";
import { AnyAction, compose, Dispatch, Middleware, MiddlewareAPI, Store } from "redux";
import { Epic } from "redux-observable";
import { Observable } from "rxjs";
@@ -44,7 +45,7 @@ export default function configureStore(
const traceFailure = (title: string, error: any) => {
if (error instanceof Error) {
onTraceFailure(title, `${error.message} ${JSON.stringify(error.stack)}`);
onTraceFailure(title, `${error.message} ${stringifyError(error.stack)}`);
console.error(error);
} else {
onTraceFailure(title, error.message);
@@ -1,3 +1,4 @@
import { stringifyError } from "Common/stringifyError";
import * as DataTables from "datatables.net";
import * as ko from "knockout";
import Q from "q";
@@ -37,7 +38,7 @@ function parseError(err: any): ErrorDataModel[] {
try {
return _parse(err);
} catch (e) {
return [<ErrorDataModel>{ message: JSON.stringify(err) }];
return [<ErrorDataModel>{ message: stringifyError(err) }];
}
}