mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
25 lines
604 B
TypeScript
25 lines
604 B
TypeScript
import { replaceSensitiveText } from '../string/tools';
|
|
|
|
export const getErrText = (err: any, def = ''): any => {
|
|
const msg: string =
|
|
typeof err === 'string'
|
|
? err
|
|
: err?.response?.data?.message ||
|
|
err?.response?.message ||
|
|
err?.message ||
|
|
err?.response?.data?.msg ||
|
|
err?.response?.msg ||
|
|
err?.msg ||
|
|
err?.error ||
|
|
def;
|
|
// msg && console.log('error =>', msg);
|
|
return replaceSensitiveText(msg);
|
|
};
|
|
|
|
export class UserError extends Error {
|
|
constructor(message: string) {
|
|
super(message);
|
|
this.name = 'UserError';
|
|
}
|
|
}
|