chore: 避免 stack 不存在导致的报错 (#5815)

This commit is contained in:
吴多益 2022-11-28 09:58:08 +08:00 committed by GitHub
parent fbccd04ab0
commit 966f6df162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@ exports.handler = (event, context, callback) => {
const entry = require('./mock/index');
entry(mockRequest(event, context), mockResponse(event, context, callback));
} catch (e) {
callback(e.stack);
callback(e);
}
};

View File

@ -391,7 +391,7 @@ export const CRUDStore = ServiceStore.named('CRUDStore')
return;
}
console.error(e.stack);
console.error(e);
env.notify('error', e.message);
return;
}

View File

@ -578,7 +578,7 @@ export const FormItemStore = StoreNode.named('FormItemStore')
return;
}
console.error(e.stack);
console.error(e);
env.notify('error', e.message);
return;
}

View File

@ -142,7 +142,7 @@ export const ServiceStore = iRendererStore
}
markFetching(false);
e.stack && console.error(e.stack);
console.error(e);
let message = e.message || e;
if (e && e.message === 'Network Error') {
message = self.__('networkError');
@ -248,7 +248,7 @@ export const ServiceStore = iRendererStore
}
markFetching(false);
e.stack && console.error(e.stack);
console.error(e);
let message = e.message || e;
if (e && e.message === 'Network Error') {
message = self.__('networkError');
@ -344,7 +344,7 @@ export const ServiceStore = iRendererStore
return;
}
// console.log(e.stack);
console.error(e);
if (e.type === 'ServerError') {
const result = (e as ServerError).response;
getEnv(self).notify(
@ -473,7 +473,7 @@ export const ServiceStore = iRendererStore
return;
}
e.stack && console.error(e.stack);
console.error(e);
let message = e.message || e;
if (e && e.message === 'Network Error') {
message = self.__('networkError');

View File

@ -221,7 +221,7 @@ export async function exportExcel(
}
});
} catch (e) {
console.warn(e.stack);
console.warn(e);
}
} else if (type == 'link' || (type as any) === 'static-link') {
const href = column.pristine.href;