Files
element-plus/packages/utils/error.ts
sea 237a61d62a chore: cancel debugWarn env check (#22657)
* chore: test

* chore: test

* chore: update
2025-10-31 23:17:19 +08:00

23 lines
621 B
TypeScript

import { isString } from './types'
class ElementPlusError extends Error {
constructor(m: string) {
super(m)
this.name = 'ElementPlusError'
}
}
export function throwError(scope: string, m: string): never {
throw new ElementPlusError(`[${scope}] ${m}`)
}
export function debugWarn(err: Error): void
export function debugWarn(scope: string, message: string): void
export function debugWarn(scope: string | Error, message?: string): void {
const error: Error = isString(scope)
? new ElementPlusError(`[${scope}] ${message}`)
: scope
// eslint-disable-next-line no-console
console.warn(error)
}