fix: auth key code

This commit is contained in:
archer
2023-05-06 14:44:48 +08:00
parent d1ee3913eb
commit 4d043e0e46
3 changed files with 28 additions and 23 deletions

View File

@@ -26,3 +26,12 @@ export const axiosConfig = () => ({
auth: process.env.OPENAI_BASE_URL_AUTH || ''
}
});
/**
* get error message
*/
export const getErrMessage = (err: any, defaultMsg = ''): string => {
const msg = typeof err === 'string' ? err : err?.message || defaultMsg || '';
msg && console.log('error =>', msg);
return msg;
};