1const stringifyError = (err: any, filter: any, space: string) => {
2 const plainObject: any = {};
3 Object.getOwnPropertyNames(err).forEach(key => {
4 plainObject[key] = err[key];
5 });
6 return JSON.stringify(plainObject, filter, space);
7};Created on 1/11/2022